mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] Fix NULL pointer dereference in cn_filter()
@ 2023-10-20 23:40 Anjali Kulkarni
  2023-10-24  9:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Anjali Kulkarni @ 2023-10-20 23:40 UTC (permalink / raw)
  To: linux-kernel
  Cc: davem, Liam.Howlett, netdev, oliver.sang, kuba, horms, anjali.k.kulkarni

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 <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>
---
 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..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;
-- 
2.42.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] Fix NULL pointer dereference in cn_filter()
  2023-10-20 23:40 [PATCH v2] Fix NULL pointer dereference in cn_filter() Anjali Kulkarni
@ 2023-10-24  9:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-24  9:20 UTC (permalink / raw)
  To: Anjali Kulkarni
  Cc: linux-kernel, davem, Liam.Howlett, netdev, oliver.sang, kuba,
	horms, anjali.k.kulkarni

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Fri, 20 Oct 2023 16:40:58 -0700 you wrote:
> 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 <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>
> 
> [...]

Here is the summary with links:
  - [v2] Fix NULL pointer dereference in cn_filter()
    https://git.kernel.org/netdev/net/c/9644bc497057

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-24  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-20 23:40 [PATCH v2] Fix NULL pointer dereference in cn_filter() Anjali Kulkarni
2023-10-24  9:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome