From: Johannes Berg <johannes@sipsolutions.net>
To: Felix Fietkau <nbd@nbd.name>,
Matthias Kaehlcke <mka@chromium.org>,
"David S . Miller" <davem@davemloft.net>,
Felix Fietkau <nbd@openwrt.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Grant Grundler <grundler@chromium.org>
Subject: Re: [PATCH] cfg80211: Fix array-bounds warning in fragment copy
Date: Mon, 27 Mar 2017 13:38:36 +0200 [thread overview]
Message-ID: <1490614716.3393.6.camel@sipsolutions.net> (raw)
In-Reply-To: <5f290298-a28c-de0c-3fef-642d32b0982d@nbd.name>
> > > - const skb_frag_t *frag = &sh->frags[-1];
> > > + const skb_frag_t *frag = &sh->frags[0];
[...]
> > > + frag--;
> >
> > Isn't it just a question of time until the compiler will see
> > through this trick and warn about it?
>
> Frag is incremented again before being accessed, so there is nothing
> for the compiler to see through here.
But by that argument the existing code was already fine. The compiler
flagged it nonetheless, perhaps because it couldn't prove it was
incremented unconditionally/in all branches?
johannes
next prev parent reply other threads:[~2017-03-27 11:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-25 1:06 [PATCH] cfg80211: Fix array-bounds warning in fragment copy Matthias Kaehlcke
2017-03-27 10:47 ` Johannes Berg
2017-03-27 11:29 ` Felix Fietkau
2017-03-27 11:38 ` Johannes Berg [this message]
2017-03-27 19:32 ` Matthias Kaehlcke
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=1490614716.3393.6.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=grundler@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mka@chromium.org \
--cc=nbd@nbd.name \
--cc=nbd@openwrt.org \
--cc=netdev@vger.kernel.org \
/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).