netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Edward Adam Davis <eadavis@qq.com>
Cc: syzbot+c229849f5b6c82eba3c2@syzkaller.appspotmail.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, syzkaller-bugs@googlegroups.com,
	Jeongjun Park <aha310510@gmail.com>
Subject: Re: [PATCH net] net: hsr: Fix null-ptr-deref in hsr_proxy_announce
Date: Wed, 11 Sep 2024 09:39:58 +0100	[thread overview]
Message-ID: <20240911083958.GC678243@kernel.org> (raw)
In-Reply-To: <tencent_CF67CC46D7D2DBC677898AEEFBAECD0CAB06@qq.com>

+ Jeongjun Park, syzbot+c229849f5b6c82eba3c2

On Tue, Sep 10, 2024 at 10:50:40PM +0800, Edward Adam Davis wrote:
> The NULL pointer is interlink, return by hsr_port_get_hsr(), before using it,
> it is necessary to add a null pointer check.
> 
> [Syzbot reported]
> Oops: general protection fault, probably for non-canonical address 0xdffffc0000000003: 0000 [#1] PREEMPT SMP KASAN PTI
> KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f]
> CPU: 0 UID: 0 PID: 11 Comm: kworker/u8:0 Not tainted 6.11.0-rc6-syzkaller-00180-g4c8002277167 #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
> Workqueue: netns cleanup_net
> RIP: 0010:send_hsr_supervision_frame+0x37/0xa90 net/hsr/hsr_device.c:290
> Code: 53 48 83 ec 38 48 89 54 24 30 49 89 f7 49 89 fd 48 bb 00 00 00 00 00 fc ff df e8 54 a0 f9 f5 49 8d 6d 18 48 89 e8 48 c1 e8 03 <80> 3c 18 00 74 08 48 89 ef e8 7b e6 60 f6 48 8b 6d 00 4d 89 fc 49
> RSP: 0018:ffffc90000007a70 EFLAGS: 00010206
> RAX: 0000000000000003 RBX: dffffc0000000000 RCX: ffff88801ced3c00
> RDX: 0000000000000100 RSI: ffffc90000007b40 RDI: 0000000000000000
> RBP: 0000000000000018 R08: ffffffff8b995013 R09: 1ffffffff283c908
> R10: dffffc0000000000 R11: ffffffff8b99ec30 R12: ffff888065030e98
> R13: 0000000000000000 R14: ffff888065030cf0 R15: ffffc90000007b40
> FS:  0000000000000000(0000) GS:ffff8880b8800000(0000) knlGS:0000000000000000
> CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> CR2: 00007f76c4f21cf8 CR3: 000000000e734000 CR4: 00000000003506f0
> DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> Call Trace:
>  <IRQ>
>  hsr_proxy_announce+0x23a/0x4c0 net/hsr/hsr_device.c:420
>  call_timer_fn+0x18e/0x650 kernel/time/timer.c:1792
>  expire_timers kernel/time/timer.c:1843 [inline]
>  __run_timers kernel/time/timer.c:2417 [inline]
>  __run_timer_base+0x66a/0x8e0 kernel/time/timer.c:2428
>  run_timer_base kernel/time/timer.c:2437 [inline]
>  run_timer_softirq+0xb7/0x170 kernel/time/timer.c:2447
>  handle_softirqs+0x2c4/0x970 kernel/softirq.c:554
>  __do_softirq kernel/softirq.c:588 [inline]
>  invoke_softirq kernel/softirq.c:428 [inline]
>  __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637
>  irq_exit_rcu+0x9/0x30 kernel/softirq.c:649
>  instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline]
>  sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043
>  
> Fixes: 5f703ce5c98 ("net: hsr: Send supervisory frames to HSR network with ProxyNodeTable data")
> Reported-by: syzbot+c229849f5b6c82eba3c2@syzkaller.appspotmail.com
> Signed-off-by: Edward Adam Davis <eadavis@qq.com>

Hi Edward,

Thanks for your patch. I agree that it is correct.  But I also believe that
it duplicates a slightly earlier patch by Jeongjun Park.

- [PATCH net] net: hsr: prevent NULL pointer dereference in hsr_proxy_announce()
  https://lore.kernel.org/all/20240907190341.162289-1-aha310510@gmail.com/

Unfortunately we don't seem to have a "duplicate" state in patchwork,
so I'll go for "rejected".

It also seems that there are duplicate syzbot reports for this problem [1][2]
I will attempt to mark [2] as a duplicate of [1].

[1] https://syzkaller.appspot.com/bug?extid=02a42d9b1bd395cbcab4
[2] https://syzkaller.appspot.com/bug?extid=c229849f5b6c82eba3c2

-- 
pw-bot: rejected

  reply	other threads:[~2024-09-11  8:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 14:00 [syzbot] [net?] general protection fault in send_hsr_supervision_frame (2) syzbot
2024-09-10 14:50 ` [PATCH net] net: hsr: Fix null-ptr-deref in hsr_proxy_announce Edward Adam Davis
2024-09-11  8:39   ` Simon Horman [this message]
2024-09-11  8:34 ` [syzbot] [net?] general protection fault in send_hsr_supervision_frame (2) Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240911083958.GC678243@kernel.org \
    --to=horms@kernel.org \
    --cc=aha310510@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eadavis@qq.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+c229849f5b6c82eba3c2@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).