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 <oliver.sang@intel.com> Closes: https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com/ Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@oracle.com> Link: https://lore.kernel.org/r/20231020234058.2232347-1-anjali.k.kulkarni@oracle.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
1 parent d788c93 commit 9644bc4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)