aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnjali Kulkarni <[email protected]>2023-10-20 16:40:58 -0700
committerPaolo Abeni <[email protected]>2023-10-24 10:53:45 +0200
commit9644bc49705723bf7c69aa9bf542bb5161b91dba (patch)
tree1ecf816f481ab9266bfb4e3c065d5601c97932b5
parentd788c9338342a3146d115281922901c1e3e1cbff (diff)
Fix NULL pointer dereference in cn_filter()
Check that sk_user_data is not NULL, else return from cn_filter(). Could not reproduce this issue, but Oliver Sang verified it has fixed the "Closes" problem below. Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs") Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-lkp/[email protected]/ Signed-off-by: Anjali Kulkarni <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Paolo Abeni <[email protected]>
-rw-r--r--drivers/connector/cn_proc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 05d562e9c8b1..44b19e696176 100644
--- a/drivers/connector/cn_proc.c
+++ b/drivers/connector/cn_proc.c
@@ -54,7 +54,7 @@ static int cn_filter(struct sock *dsk, struct sk_buff *skb, void *data)
enum proc_cn_mcast_op mc_op;
uintptr_t val;
- if (!dsk || !data)
+ if (!dsk || !dsk->sk_user_data || !data)
return 0;
ptr = (__u32 *)data;