From: Julia Lawall <julia.lawall@lip6.fr>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
Chris Bainbridge <chris.bainbridge@gmail.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-wireless <linux-wireless@vger.kernel.org>,
aryabinin@virtuozzo.com, Julia Lawall <Julia.Lawall@lip6.fr>,
kernel-janitors@vger.kernel.org, Joe Perches <joe@perches.com>
Subject: Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values
Date: Thu, 28 Jan 2016 11:24:03 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.10.1601281120580.2516@hadrien> (raw)
In-Reply-To: <CAGRGNgVqtj8SwP-gEt0ZnbgWzgVHjcY9Q=JyB6bf6d_m+8mvhA@mail.gmail.com>
On Thu, 28 Jan 2016, Julian Calaby wrote:
> Hi Johannes,
>
> On Thu, Jan 28, 2016 at 8:48 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Thu, 2016-01-28 at 10:27 +1100, Julian Calaby wrote:
> >> I'd prefer to just set ->removed to false right after we set
> >> ->auto_seq as that should be faster, however I don't know if
> >> __ieee80211_start_rx_ba_session() is a fast path so I don't know if
> >> this is saving anything.
> >
> > It's not supposed to be called frequently, no.
>
> Then most of my commentary is moot.
>
> I guess the argument comes down to do we zero everything or initialise
> everything, and if speed isn't an issue, the former is better.
>
> >> On another note, this is an error that should be pretty easy to spot.
> >> Could any of the automated tools find cases where a struct containing
> >> a bool variable is kmalloc'd and returned without assigning all the
> >> bools?
> >
> > I think you'd quickly drown in false positives, since "return" isn't
> > necessarily something that means it needs to have been fully
> > initialized.
>
> True.
>
> Either way, I'm guessing that UBSAN will pick up a lot of similar bugs
> and the output of that is probably a much smaller haystack to dig
> through than just "every" kmalloc() call.
It could be possible to find the cases where most of the fields are
initialized, but one is left out. This could be done for all the fields of
a given type, or in general.
julia
next prev parent reply other threads:[~2016-01-28 10:24 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 11:17 UBSAN: Undefined behaviour in net/mac80211/rx.c:924:18 Chris Bainbridge
2016-01-27 15:46 ` [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Chris Bainbridge
2016-01-27 23:27 ` Julian Calaby
2016-01-28 9:48 ` Johannes Berg
2016-01-28 10:11 ` Julian Calaby
2016-01-28 10:24 ` Julia Lawall [this message]
2016-01-28 12:30 ` Dan Carpenter
2016-01-28 12:35 ` Johannes Berg
2016-01-28 9:47 ` Johannes Berg
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=alpine.DEB.2.10.1601281120580.2516@hadrien \
--to=julia.lawall@lip6.fr \
--cc=aryabinin@virtuozzo.com \
--cc=chris.bainbridge@gmail.com \
--cc=joe@perches.com \
--cc=johannes@sipsolutions.net \
--cc=julian.calaby@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@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