[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231013225619.987912-1-anjali.k.kulkarni@oracle.com>
Date: Fri, 13 Oct 2023 15:56:19 -0700
From: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
To: linux-kernel@...r.kernel.org
Cc: davem@...emloft.net, Liam.Howlett@...cle.com, netdev@...r.kernel.org,
oliver.sang@...el.com, kuba@...nel.org, horms@...nel.org,
anjali.k.kulkarni@...cle.com
Subject: [PATCH v1] Fix NULL pointer dereference in cn_filter()
Check that sk_user_data is not NULL, else return from cn_filter().
Fixes: 2aa1f7a1f47c ("connector/cn_proc: Add filtering to fix some bugs")
Reported-by: kernel test robot <oliver.sang@...el.com>
Closes: https://lore.kernel.org/oe-lkp/202309201456.84c19e27-oliver.sang@intel.com/
Signed-off-by: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
---
drivers/connector/cn_proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c
index 05d562e9c8b1..a8e55569e4f5 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 || !data || !dsk->sk_user_data)
return 0;
ptr = (__u32 *)data;
--
2.42.0
Powered by blists - more mailing lists