public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [net?] KASAN: null-ptr-deref Write in send_to_lecd
@ 2026-03-09 12:13 syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-03-09 12:13 UTC (permalink / raw)
  To: davem, edumazet, horms, kuba, linux-kernel, netdev, pabeni,
	syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    014441d1e4b2 Merge tag 'i2c-for-7.0-rc3' of git://git.kern..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=11230d52580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=976ba5a93c4add9e
dashboard link: https://syzkaller.appspot.com/bug?extid=e1d2b89a60c8bb9a7f33
compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/c6996386f74c/disk-014441d1.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/50d7e742ec37/vmlinux-014441d1.xz
kernel image: https://storage.googleapis.com/syzbot-assets/8b042e15289c/bzImage-014441d1.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e1d2b89a60c8bb9a7f33@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_read_write include/linux/instrumented.h:112 [inline]
BUG: KASAN: null-ptr-deref in atomic_add include/linux/atomic/atomic-instrumented.h:104 [inline]
BUG: KASAN: null-ptr-deref in atm_force_charge include/linux/atmdev.h:261 [inline]
BUG: KASAN: null-ptr-deref in send_to_lecd+0x2ef/0x5e0 net/atm/lec.c:535
Write of size 4 at addr 0000000000000140 by task dhcpcd/28797

CPU: 1 UID: 101 PID: 28797 Comm: dhcpcd Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 kasan_report+0xdf/0x1e0 mm/kasan/report.c:595
 check_region_inline mm/kasan/generic.c:186 [inline]
 kasan_check_range+0x10f/0x1e0 mm/kasan/generic.c:200
 instrument_atomic_read_write include/linux/instrumented.h:112 [inline]
 atomic_add include/linux/atomic/atomic-instrumented.h:104 [inline]
 atm_force_charge include/linux/atmdev.h:261 [inline]
 send_to_lecd+0x2ef/0x5e0 net/atm/lec.c:535
 lec_arp_resolve net/atm/lec.c:1791 [inline]
 lec_start_xmit+0x1252/0x2070 net/atm/lec.c:285
 __netdev_start_xmit include/linux/netdevice.h:5292 [inline]
 netdev_start_xmit include/linux/netdevice.h:5301 [inline]
 xmit_one net/core/dev.c:3871 [inline]
 dev_hard_start_xmit+0x121/0x7d0 net/core/dev.c:3887
 sch_direct_xmit+0x1b2/0xc60 net/sched/sch_generic.c:347
 qdisc_restart net/sched/sch_generic.c:412 [inline]
 __qdisc_run+0x52d/0x1b10 net/sched/sch_generic.c:420
 qdisc_run include/net/pkt_sched.h:120 [inline]
 qdisc_run include/net/pkt_sched.h:117 [inline]
 __dev_xmit_skb net/core/dev.c:4196 [inline]
 __dev_queue_xmit+0x196d/0x4800 net/core/dev.c:4802
 dev_queue_xmit include/linux/netdevice.h:3384 [inline]
 packet_xmit+0x243/0x310 net/packet/af_packet.c:275
 packet_snd net/packet/af_packet.c:3076 [inline]
 packet_sendmsg+0x32f4/0x53c0 net/packet/af_packet.c:3108
 sock_sendmsg_nosec net/socket.c:727 [inline]
 __sock_sendmsg net/socket.c:742 [inline]
 sock_write_iter+0x524/0x5a0 net/socket.c:1195
 do_iter_readv_writev+0x6ee/0x920 fs/read_write.c:829
 vfs_writev+0x360/0xe10 fs/read_write.c:1059
 do_writev+0x28a/0x340 fs/read_write.c:1105
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f53f6e3c407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007fff9cf80170 EFLAGS: 00000202 ORIG_RAX: 0000000000000014
RAX: ffffffffffffffda RBX: 00007f53f6db2780 RCX: 00007f53f6e3c407
RDX: 0000000000000002 RSI: 00007fff9cf801d0 RDI: 0000000000000003
RBP: 0000000000000188 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 00007fff9cf80210
R13: 0000562512791790 R14: 00007fff9cf80260 R15: 00007fff9cf90430
 </TASK>
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

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

* Re: [syzbot] [net?] KASAN: null-ptr-deref Write in send_to_lecd
       [not found] <aeT90iYRUqJgbOTO@JMW-Ubuntu>
@ 2026-04-19 16:07 ` syzbot
  0 siblings, 0 replies; 2+ messages in thread
From: syzbot @ 2026-04-19 16:07 UTC (permalink / raw)
  To: s9430939; +Cc: s9430939, linux-kernel, syzkaller-bugs

> #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 014441d1e4b2

This crash does not have a reproducer. I cannot test it.

>
> net: atm: lec: fix null-ptr-deref in send_to_lecd
>
> A null pointer dereference occurs in send_to_lecd() when accessing
> priv->lecd. Although priv->lecd is checked at the function's entry,
> it can be cleared by lec_atm_close() before it is actually used.
>
> Use READ_ONCE() to load priv->lecd into a local variable and check
> it before use.
>
> Reported-by: syzbot+e1d2b89a60c8bb9a7f33@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=e1d2b89a60c8bb9a7f33
> Signed-off-by: Minu Jin <s9430939@naver.com>
>
> ---
>  net/atm/lec.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/net/atm/lec.c b/net/atm/lec.c
> index fb93c6e1c329..34f4c32acadb 100644
> --- a/net/atm/lec.c
> +++ b/net/atm/lec.c
> @@ -512,10 +512,16 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
>  {
>  	struct sock *sk;
>  	struct sk_buff *skb;
> +	struct atm_vcc *lecd;
>  	struct atmlec_msg *mesg;
>  
> -	if (!priv || !priv->lecd)
> +	if (!priv)
>  		return -1;
> +
> +	lecd = READ_ONCE(priv->lecd);
> +	if (!lecd)
> +		return -1;
> +
>  	skb = alloc_skb(sizeof(struct atmlec_msg), GFP_ATOMIC);
>  	if (!skb)
>  		return -1;
> @@ -532,14 +538,14 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
>  	if (atm_addr)
>  		memcpy(&mesg->content.normal.atm_addr, atm_addr, ATM_ESA_LEN);
>  
> -	atm_force_charge(priv->lecd, skb->truesize);
> -	sk = sk_atm(priv->lecd);
> +	atm_force_charge(lecd, skb->truesize);
> +	sk = sk_atm(lecd);
>  	skb_queue_tail(&sk->sk_receive_queue, skb);
>  	sk->sk_data_ready(sk);
>  
>  	if (data != NULL) {
>  		pr_debug("about to send %d bytes of data\n", data->len);
> -		atm_force_charge(priv->lecd, data->truesize);
> +		atm_force_charge(lecd, data->truesize);
>  		skb_queue_tail(&sk->sk_receive_queue, data);
>  		sk->sk_data_ready(sk);
>  	}
> -- 
> 2.43.0

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

end of thread, other threads:[~2026-04-19 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <aeT90iYRUqJgbOTO@JMW-Ubuntu>
2026-04-19 16:07 ` [syzbot] [net?] KASAN: null-ptr-deref Write in send_to_lecd syzbot
2026-03-09 12:13 syzbot

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