netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg()
@ 2025-07-05  8:52 Yue Haibing
  2025-07-09 18:56 ` Simon Horman
  2025-07-10  2:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Yue Haibing @ 2025-07-05  8:52 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, horms; +Cc: netdev, linux-kernel, yuehaibing

atmarpd_dev_ops does not implement the send method, which may cause crash
as bellow.

BUG: kernel NULL pointer dereference, address: 0000000000000000
PGD 0 P4D 0
Oops: Oops: 0010 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:0x0
Code: Unable to access opcode bytes at 0xffffffffffffffd6.
RSP: 0018:ffffc9000d3cf778 EFLAGS: 00010246
RAX: 1ffffffff1910dd1 RBX: 00000000000000c0 RCX: dffffc0000000000
RDX: ffffc9000dc82000 RSI: ffff88803e4c4640 RDI: ffff888052cd0000
RBP: ffffc9000d3cf8d0 R08: ffff888052c9143f R09: 1ffff1100a592287
R10: dffffc0000000000 R11: 0000000000000000 R12: 1ffff92001a79f00
R13: ffff888052cd0000 R14: ffff88803e4c4640 R15: ffffffff8c886e88
FS:  00007fbc762566c0(0000) GS:ffff88808d6c2000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 0000000041f1b000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 vcc_sendmsg+0xa10/0xc50 net/atm/common.c:644
 sock_sendmsg_nosec net/socket.c:712 [inline]
 __sock_sendmsg+0x219/0x270 net/socket.c:727
 ____sys_sendmsg+0x52d/0x830 net/socket.c:2566
 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620
 __sys_sendmmsg+0x227/0x430 net/socket.c:2709
 __do_sys_sendmmsg net/socket.c:2736 [inline]
 __se_sys_sendmmsg net/socket.c:2733 [inline]
 __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2733
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Reported-by: syzbot+e34e5e6b5eddb0014def@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/682f82d5.a70a0220.1765ec.0143.GAE@google.com/T
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
v2: Add atm_return_tx() call
---
 net/atm/clip.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/atm/clip.c b/net/atm/clip.c
index b234dc3bcb0d..170f9386d42d 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -616,8 +616,16 @@ static void atmarpd_close(struct atm_vcc *vcc)
 	module_put(THIS_MODULE);
 }
 
+static int atmarpd_send(struct atm_vcc *vcc, struct sk_buff *skb)
+{
+	atm_return_tx(vcc, skb);
+	dev_kfree_skb_any(skb);
+	return 0;
+}
+
 static const struct atmdev_ops atmarpd_dev_ops = {
-	.close = atmarpd_close
+	.close = atmarpd_close,
+	.send = atmarpd_send
 };
 
 
-- 
2.34.1


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

* Re: [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg()
  2025-07-05  8:52 [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg() Yue Haibing
@ 2025-07-09 18:56 ` Simon Horman
  2025-07-09 19:04   ` Kuniyuki Iwashima
  2025-07-10  2:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Horman @ 2025-07-09 18:56 UTC (permalink / raw)
  To: Yue Haibing
  Cc: davem, edumazet, kuba, pabeni, netdev, linux-kernel,
	Kuniyuki Iwashima

+ Iwashima-san

On Sat, Jul 05, 2025 at 04:52:28PM +0800, Yue Haibing wrote:
> atmarpd_dev_ops does not implement the send method, which may cause crash
> as bellow.
> 
> BUG: kernel NULL pointer dereference, address: 0000000000000000
> PGD 0 P4D 0
> Oops: Oops: 0010 [#1] SMP KASAN NOPTI
> CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full)
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
> RIP: 0010:0x0
> Code: Unable to access opcode bytes at 0xffffffffffffffd6.
> RSP: 0018:ffffc9000d3cf778 EFLAGS: 00010246
> RAX: 1ffffffff1910dd1 RBX: 00000000000000c0 RCX: dffffc0000000000
> RDX: ffffc9000dc82000 RSI: ffff88803e4c4640 RDI: ffff888052cd0000
> RBP: ffffc9000d3cf8d0 R08: ffff888052c9143f R09: 1ffff1100a592287
> R10: dffffc0000000000 R11: 0000000000000000 R12: 1ffff92001a79f00
> R13: ffff888052cd0000 R14: ffff88803e4c4640 R15: ffffffff8c886e88
> FS:  00007fbc762566c0(0000) GS:ffff88808d6c2000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: ffffffffffffffd6 CR3: 0000000041f1b000 CR4: 0000000000352ef0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  <TASK>
>  vcc_sendmsg+0xa10/0xc50 net/atm/common.c:644
>  sock_sendmsg_nosec net/socket.c:712 [inline]
>  __sock_sendmsg+0x219/0x270 net/socket.c:727
>  ____sys_sendmsg+0x52d/0x830 net/socket.c:2566
>  ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620
>  __sys_sendmmsg+0x227/0x430 net/socket.c:2709
>  __do_sys_sendmmsg net/socket.c:2736 [inline]
>  __se_sys_sendmmsg net/socket.c:2733 [inline]
>  __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2733
>  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>  do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Reported-by: syzbot+e34e5e6b5eddb0014def@syzkaller.appspotmail.com
> Closes: https://lore.kernel.org/all/682f82d5.a70a0220.1765ec.0143.GAE@google.com/T
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
> ---
> v2: Add atm_return_tx() call
> ---
>  net/atm/clip.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/net/atm/clip.c b/net/atm/clip.c
> index b234dc3bcb0d..170f9386d42d 100644
> --- a/net/atm/clip.c
> +++ b/net/atm/clip.c
> @@ -616,8 +616,16 @@ static void atmarpd_close(struct atm_vcc *vcc)
>  	module_put(THIS_MODULE);
>  }
>  
> +static int atmarpd_send(struct atm_vcc *vcc, struct sk_buff *skb)
> +{
> +	atm_return_tx(vcc, skb);
> +	dev_kfree_skb_any(skb);
> +	return 0;
> +}
> +
>  static const struct atmdev_ops atmarpd_dev_ops = {
> -	.close = atmarpd_close
> +	.close = atmarpd_close,
> +	.send = atmarpd_send
>  };
>  
>  
> -- 
> 2.34.1
> 

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

* Re: [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg()
  2025-07-09 18:56 ` Simon Horman
@ 2025-07-09 19:04   ` Kuniyuki Iwashima
  0 siblings, 0 replies; 4+ messages in thread
From: Kuniyuki Iwashima @ 2025-07-09 19:04 UTC (permalink / raw)
  To: Simon Horman
  Cc: Yue Haibing, davem, edumazet, kuba, pabeni, netdev, linux-kernel

On Wed, Jul 9, 2025 at 11:56 AM Simon Horman <horms@kernel.org> wrote:
>
> + Iwashima-san

Thank you, Simon :)

>
> On Sat, Jul 05, 2025 at 04:52:28PM +0800, Yue Haibing wrote:
> > atmarpd_dev_ops does not implement the send method, which may cause crash
> > as bellow.
> >
> > BUG: kernel NULL pointer dereference, address: 0000000000000000
> > PGD 0 P4D 0
> > Oops: Oops: 0010 [#1] SMP KASAN NOPTI
> > CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full)
> > Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
> > RIP: 0010:0x0
> > Code: Unable to access opcode bytes at 0xffffffffffffffd6.
> > RSP: 0018:ffffc9000d3cf778 EFLAGS: 00010246
> > RAX: 1ffffffff1910dd1 RBX: 00000000000000c0 RCX: dffffc0000000000
> > RDX: ffffc9000dc82000 RSI: ffff88803e4c4640 RDI: ffff888052cd0000
> > RBP: ffffc9000d3cf8d0 R08: ffff888052c9143f R09: 1ffff1100a592287
> > R10: dffffc0000000000 R11: 0000000000000000 R12: 1ffff92001a79f00
> > R13: ffff888052cd0000 R14: ffff88803e4c4640 R15: ffffffff8c886e88
> > FS:  00007fbc762566c0(0000) GS:ffff88808d6c2000(0000) knlGS:0000000000000000
> > CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > CR2: ffffffffffffffd6 CR3: 0000000041f1b000 CR4: 0000000000352ef0
> > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > Call Trace:
> >  <TASK>
> >  vcc_sendmsg+0xa10/0xc50 net/atm/common.c:644
> >  sock_sendmsg_nosec net/socket.c:712 [inline]
> >  __sock_sendmsg+0x219/0x270 net/socket.c:727
> >  ____sys_sendmsg+0x52d/0x830 net/socket.c:2566
> >  ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620
> >  __sys_sendmmsg+0x227/0x430 net/socket.c:2709
> >  __do_sys_sendmmsg net/socket.c:2736 [inline]
> >  __se_sys_sendmmsg net/socket.c:2733 [inline]
> >  __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2733
> >  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
> >  do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
> >  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> >
> > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> > Reported-by: syzbot+e34e5e6b5eddb0014def@syzkaller.appspotmail.com
> > Closes: https://lore.kernel.org/all/682f82d5.a70a0220.1765ec.0143.GAE@google.com/T
> > Signed-off-by: Yue Haibing <yuehaibing@huawei.com>

v2 looks good.

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

Thanks!

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

* Re: [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg()
  2025-07-05  8:52 [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg() Yue Haibing
  2025-07-09 18:56 ` Simon Horman
@ 2025-07-10  2:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-07-10  2:30 UTC (permalink / raw)
  To: Yue Haibing; +Cc: davem, edumazet, kuba, pabeni, horms, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 5 Jul 2025 16:52:28 +0800 you wrote:
> atmarpd_dev_ops does not implement the send method, which may cause crash
> as bellow.
> 
> BUG: kernel NULL pointer dereference, address: 0000000000000000
> PGD 0 P4D 0
> Oops: Oops: 0010 [#1] SMP KASAN NOPTI
> CPU: 0 UID: 0 PID: 5324 Comm: syz.0.0 Not tainted 6.15.0-rc6-syzkaller-00346-g5723cc3450bc #0 PREEMPT(full)
> Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
> RIP: 0010:0x0
> Code: Unable to access opcode bytes at 0xffffffffffffffd6.
> RSP: 0018:ffffc9000d3cf778 EFLAGS: 00010246
> RAX: 1ffffffff1910dd1 RBX: 00000000000000c0 RCX: dffffc0000000000
> RDX: ffffc9000dc82000 RSI: ffff88803e4c4640 RDI: ffff888052cd0000
> RBP: ffffc9000d3cf8d0 R08: ffff888052c9143f R09: 1ffff1100a592287
> R10: dffffc0000000000 R11: 0000000000000000 R12: 1ffff92001a79f00
> R13: ffff888052cd0000 R14: ffff88803e4c4640 R15: ffffffff8c886e88
> FS:  00007fbc762566c0(0000) GS:ffff88808d6c2000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: ffffffffffffffd6 CR3: 0000000041f1b000 CR4: 0000000000352ef0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  <TASK>
>  vcc_sendmsg+0xa10/0xc50 net/atm/common.c:644
>  sock_sendmsg_nosec net/socket.c:712 [inline]
>  __sock_sendmsg+0x219/0x270 net/socket.c:727
>  ____sys_sendmsg+0x52d/0x830 net/socket.c:2566
>  ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2620
>  __sys_sendmmsg+0x227/0x430 net/socket.c:2709
>  __do_sys_sendmmsg net/socket.c:2736 [inline]
>  __se_sys_sendmmsg net/socket.c:2733 [inline]
>  __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2733
>  do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
>  do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
>  entry_SYSCALL_64_after_hwframe+0x77/0x7f
> 
> [...]

Here is the summary with links:
  - [v2,net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg()
    https://git.kernel.org/netdev/net/c/22fc46cea91d

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] 4+ messages in thread

end of thread, other threads:[~2025-07-10  2:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-05  8:52 [PATCH v2 net] atm: clip: Fix NULL pointer dereference in vcc_sendmsg() Yue Haibing
2025-07-09 18:56 ` Simon Horman
2025-07-09 19:04   ` Kuniyuki Iwashima
2025-07-10  2:30 ` 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;
as well as URLs for NNTP newsgroup(s).