netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: syzbot <syzbot+5078fc2d7cf37d71de1c@syzkaller.appspotmail.com>
Cc: David Miller <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	Jakub Kicinski <kuba@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Steffen Klassert <steffen.klassert@secunet.com>,
	syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: general protection fault in xfrm_user_rcv_msg_compat
Date: Tue, 23 Feb 2021 14:44:50 -0800	[thread overview]
Message-ID: <CAM_iQpVOyYGoWdEkZ62yYRoK0G+xEPqYBod2=8QOu9d8X3-c1w@mail.gmail.com> (raw)
In-Reply-To: <000000000000d8369805bc01fe68@google.com>

On Tue, Feb 23, 2021 at 6:55 AM syzbot
<syzbot+5078fc2d7cf37d71de1c@syzkaller.appspotmail.com> wrote:
>
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit:    a99163e9 Merge tag 'devicetree-for-5.12' of git://git.kern..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=11a6fccad00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=7a875029a795d230
> dashboard link: https://syzkaller.appspot.com/bug?extid=5078fc2d7cf37d71de1c
> userspace arch: i386
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=167c1832d00000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=10214f12d00000
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+5078fc2d7cf37d71de1c@syzkaller.appspotmail.com
>
> general protection fault, probably for non-canonical address 0xe51af2c1f2c7bd20: 0000 [#1] PREEMPT SMP KASAN
> KASAN: maybe wild-memory-access in range [0x28d7b60f963de900-0x28d7b60f963de907]
> CPU: 1 PID: 8357 Comm: syz-executor113 Not tainted 5.11.0-syzkaller #0
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
> RIP: 0010:nla_type include/net/netlink.h:1130 [inline]
> RIP: 0010:xfrm_xlate32_attr net/xfrm/xfrm_compat.c:404 [inline]
> RIP: 0010:xfrm_xlate32 net/xfrm/xfrm_compat.c:526 [inline]
> RIP: 0010:xfrm_user_rcv_msg_compat+0x5e5/0x1070 net/xfrm/xfrm_compat.c:571

Looks like we have to initialize the pointer array to NULL's.

diff --git a/net/xfrm/xfrm_compat.c b/net/xfrm/xfrm_compat.c
index d8e8a11ca845..56fb32f90799 100644
--- a/net/xfrm/xfrm_compat.c
+++ b/net/xfrm/xfrm_compat.c
@@ -537,7 +537,7 @@ static struct nlmsghdr
*xfrm_user_rcv_msg_compat(const struct nlmsghdr *h32,
 {
        /* netlink_rcv_skb() checks if a message has full (struct nlmsghdr) */
        u16 type = h32->nlmsg_type - XFRM_MSG_BASE;
-       struct nlattr *attrs[XFRMA_MAX+1];
+       struct nlattr *attrs[XFRMA_MAX+1] = {0};
        struct nlmsghdr *h64;
        size_t len;
        int err;

  reply	other threads:[~2021-02-23 22:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 12:42 general protection fault in xfrm_user_rcv_msg_compat syzbot
2021-02-23 14:47 ` syzbot
2021-02-23 22:44   ` Cong Wang [this message]
2021-09-06 19:29 ` [syzbot] " syzbot
2022-05-12 13:12   ` Dmitry Vyukov

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='CAM_iQpVOyYGoWdEkZ62yYRoK0G+xEPqYBod2=8QOu9d8X3-c1w@mail.gmail.com' \
    --to=xiyou.wangcong@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.com \
    --cc=syzbot+5078fc2d7cf37d71de1c@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).