From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <syzbot+e4eec4b8584ac3f936e5@syzkaller.appspotmail.com>
Cc: <davem@davemloft.net>, <dsahern@kernel.org>,
<edumazet@google.com>, <horms@kernel.org>, <kuba@kernel.org>,
<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<pabeni@redhat.com>, <syzkaller-bugs@googlegroups.com>,
<kuniyu@amazon.com>
Subject: Re: [syzbot] [net?] UBSAN: array-index-out-of-bounds in ipv6_addr_prefix
Date: Thu, 1 May 2025 17:25:22 -0700 [thread overview]
Message-ID: <20250502002616.60759-1-kuniyu@amazon.com> (raw)
In-Reply-To: <681357d6.050a0220.14dd7d.000c.GAE@google.com>
From: syzbot <syzbot+e4eec4b8584ac3f936e5@syzkaller.appspotmail.com>
Date: Thu, 01 May 2025 04:15:34 -0700
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 5565acd1e6c4 Merge git://git.kernel.org/pub/scm/linux/kern..
> git tree: net-next
> console+strace: https://syzkaller.appspot.com/x/log.txt?x=12f19574580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=2e3745cb659ef5d9
> dashboard link: https://syzkaller.appspot.com/bug?extid=e4eec4b8584ac3f936e5
> compiler: Debian clang version 20.1.2 (++20250402124445+58df0ef89dd6-1~exp1~20250402004600.97), Debian LLD 20.1.2
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10207fcf980000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16f19574580000
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/80798769614c/disk-5565acd1.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/435ecb0f1371/vmlinux-5565acd1.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/7790d5f923b6/bzImage-5565acd1.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+e4eec4b8584ac3f936e5@syzkaller.appspotmail.com
>
> ------------[ cut here ]------------
> UBSAN: array-index-out-of-bounds in ./include/net/ipv6.h:616:21
> index 16 is out of range for type 'const __u8[16]' (aka 'const unsigned char[16]')
> CPU: 0 UID: 0 PID: 5837 Comm: syz-executor401 Not tainted 6.15.0-rc3-syzkaller-00557-g5565acd1e6c4 #0 PREEMPT(full)
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
> Call Trace:
> <TASK>
> dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
> ubsan_epilogue+0xa/0x40 lib/ubsan.c:231
> __ubsan_handle_out_of_bounds+0xe9/0xf0 lib/ubsan.c:453
> ipv6_addr_prefix+0x145/0x1d0 include/net/ipv6.h:616
> ip6_route_info_create+0x629/0xa70 net/ipv6/route.c:3814
> ip6_route_mpath_info_create net/ipv6/route.c:5393 [inline]
> ip6_route_multipath_add net/ipv6/route.c:5519 [inline]
I missed err is reset by rtm_to_fib6_multipath_config()
and lwtunnel_valid_encap_type() ... I like setting
err just before goto...
so the diff below fixes,
---8<---
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index aa6b45bd3515..fee80b08bc46 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -5275,6 +5275,8 @@ static int rtm_to_fib6_config(struct sk_buff *skb, struct nlmsghdr *nlh,
}
if (newroute) {
+ err = -EINVAL;
+
/* RTF_PCPU is an internal flag; can not be set by userspace */
if (cfg->fc_flags & RTF_PCPU) {
NL_SET_ERR_MSG(extack, "Userspace can not set RTF_PCPU");
---8<---
but this patch also fixes it,
https://lore.kernel.org/netdev/20250501005335.53683-1-kuniyu@amazon.com/
so,
#syz dup: [syzbot] [net?] WARNING in ipv6_addr_prefix
prev parent reply other threads:[~2025-05-02 0:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-01 11:15 syzbot
2025-05-02 0:25 ` Kuniyuki Iwashima [this message]
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=20250502002616.60759-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=syzbot+e4eec4b8584ac3f936e5@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
all inboxes | Powered by JetHome®