From: David Ahern <dsahern@gmail.com>
To: Xin Long <lucien.xin@gmail.com>,
syzbot <syzbot+03bee3680a37466775e7@syzkaller.appspotmail.com>
Cc: Jason@zx2c4.com, "Andrey Vagin" <avagin@openvz.org>,
davem <davem@davemloft.net>,
dwindsor@gmail.com, elena.reshetova@intel.com,
"Herbert Xu" <herbert@gondor.apana.org.au>,
johannes.berg@intel.com, LKML <linux-kernel@vger.kernel.org>,
"network dev" <netdev@vger.kernel.org>,
syzkaller-bugs@googlegroups.com,
"Américo Wang" <xiyou.wangcong@gmail.com>
Subject: Re: KASAN: stack-out-of-bounds Read in __nla_put
Date: Wed, 17 Jan 2018 08:59:01 -0800 [thread overview]
Message-ID: <7b70f69c-2b8c-f031-83d8-d53b96164d12@gmail.com> (raw)
In-Reply-To: <CADvbK_dhz36U7DbNTMimS47iQD3Ayx-W+aVGp6bOt_ByY350yw@mail.gmail.com>
On 1/17/18 2:39 AM, Xin Long wrote:
> I guess you need to move up your memset(0) a little bit:
>
> @@ -2427,6 +2443,7 @@ int netlink_rcv_skb(struct sk_buff *skb, int
> (*cb)(struct sk_buff *,
> nlh = nlmsg_hdr(skb);
> err = 0;
>
> + memset(&extack, 0, sizeof(extack));
> if (nlh->nlmsg_len < NLMSG_HDRLEN || skb->len < nlh->nlmsg_len)
> return 0;
>
> @@ -2438,7 +2455,6 @@ int netlink_rcv_skb(struct sk_buff *skb, int
> (*cb)(struct sk_buff *,
> if (nlh->nlmsg_type < NLMSG_MIN_TYPE)
> goto ack;
>
> - memset(&extack, 0, sizeof(extack));
> err = cb(skb, nlh, &extack);
>
> So that 'goto ack's won't skip it. :-)
>
you are correct. Can you submit a patch to do that?
next prev parent reply other threads:[~2018-01-17 16:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-16 17:58 KASAN: stack-out-of-bounds Read in __nla_put syzbot
2018-01-17 10:39 ` Xin Long
2018-01-17 16:59 ` David Ahern [this message]
2018-01-17 17:10 ` Xin Long
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=7b70f69c-2b8c-f031-83d8-d53b96164d12@gmail.com \
--to=dsahern@gmail.com \
--cc=Jason@zx2c4.com \
--cc=avagin@openvz.org \
--cc=davem@davemloft.net \
--cc=dwindsor@gmail.com \
--cc=elena.reshetova@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=johannes.berg@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=syzbot+03bee3680a37466775e7@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=xiyou.wangcong@gmail.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).