Commit 9644bc49 authored by Anjali Kulkarni's avatar Anjali Kulkarni Committed by Paolo Abeni

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: 2aa1f7a1 ("connector/cn_proc: Add filtering to fix some bugs")
Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com/Signed-off-by: default avatarAnjali Kulkarni <anjali.k.kulkarni@oracle.com>
Link: https://lore.kernel.org/r/20231020234058.2232347-1-anjali.k.kulkarni@oracle.comSigned-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent d788c933
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment