Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1320518

Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values

From Julian Calaby <julian.calaby@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values
Date 2016-01-28 11:20 +0100
Message-ID <qVRQf-1UP-33@gated-at.bofh.it> (permalink)
References <qV9Pc-3ib-11@gated-at.bofh.it> <qVAw3-5GW-29@gated-at.bofh.it> <qVHHc-2KP-21@gated-at.bofh.it> <qVRnd-1sZ-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Julian Calaby <julian.calaby@gmail.com> - 2016-01-28 00:30 +0100
  Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Johannes Berg <johannes@sipsolutions.net> - 2016-01-28 10:50 +0100
    Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Julian Calaby <julian.calaby@gmail.com> - 2016-01-28 11:20 +0100
      Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Julia Lawall <julia.lawall@lip6.fr> - 2016-01-28 11:30 +0100
  Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Johannes Berg <johannes@sipsolutions.net> - 2016-01-28 13:40 +0100
  Re: [PATCH] net/mac80211/agg-rx.c: fix use of uninitialised values Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-28 13:40 +0100

csiph-web