Skip to content

Commit 9644bc4

Browse files
anjalidkPaolo Abeni
authored andcommitted
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: 2aa1f7a ("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]>
1 parent d788c93 commit 9644bc4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/connector/cn_proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static int cn_filter(struct sock *dsk, struct sk_buff *skb, void *data)
5454
enum proc_cn_mcast_op mc_op;
5555
uintptr_t val;
5656

57-
if (!dsk || !data)
57+
if (!dsk || !dsk->sk_user_data || !data)
5858
return 0;
5959

6060
ptr = (__u32 *)data;

0 commit comments

Comments
 (0)