From: Bob Copeland <me@bobcopeland.com> To: Johannes Berg <johannes@sipsolutions.net> Cc: Michal Kazior <michal.kazior@tieto.com>, linux-wireless <linux-wireless@vger.kernel.org>, "ath10k@lists.infradead.org" <ath10k@lists.infradead.org> Subject: Re: [PATCH] ath10k: fix potential null dereference bugs Date: Mon, 13 Jun 2016 09:05:07 -0400 [thread overview] Message-ID: <20160613130507.GA11074@localhost> (raw) In-Reply-To: <1465808939.2434.1.camel@sipsolutions.net> On Mon, Jun 13, 2016 at 11:08:59AM +0200, Johannes Berg wrote: > On Mon, 2016-06-13 at 07:39 +0200, Michal Kazior wrote: > > > > FWIW all of these are false positives. I think this was already > > pointed out some time ago. The drv_priv stuff is merely an offset > > (see how ieee80211_vif and ieee80211_sta are defined) and the > > according structure is always checked beforehand. OK, fair enough, sorry for the noise. I'm daily running sparse / smatch on wireless-testing; although these had been around for a while they showed up as new "errors" because of some line number changes, but I'll squelch them going forward. > IIRC, doing something like that can (sometimes?) still get you into > undefined behaviour territory, so the compiler could potentially > "optimize" away the later NULL check. So I did just go and check the generated code for each of these cases and gcc didn't elide the subsequent if-test, at least on x86-64 and my compiler / build config. Given http://lwn.net/Articles/342330, it seems possible, though. -- Bob Copeland %% http://bobcopeland.com/
WARNING: multiple messages have this Message-ID (diff)
From: Bob Copeland <me@bobcopeland.com> To: Johannes Berg <johannes@sipsolutions.net> Cc: linux-wireless <linux-wireless@vger.kernel.org>, Michal Kazior <michal.kazior@tieto.com>, "ath10k@lists.infradead.org" <ath10k@lists.infradead.org> Subject: Re: [PATCH] ath10k: fix potential null dereference bugs Date: Mon, 13 Jun 2016 09:05:07 -0400 [thread overview] Message-ID: <20160613130507.GA11074@localhost> (raw) In-Reply-To: <1465808939.2434.1.camel@sipsolutions.net> On Mon, Jun 13, 2016 at 11:08:59AM +0200, Johannes Berg wrote: > On Mon, 2016-06-13 at 07:39 +0200, Michal Kazior wrote: > > > > FWIW all of these are false positives. I think this was already > > pointed out some time ago. The drv_priv stuff is merely an offset > > (see how ieee80211_vif and ieee80211_sta are defined) and the > > according structure is always checked beforehand. OK, fair enough, sorry for the noise. I'm daily running sparse / smatch on wireless-testing; although these had been around for a while they showed up as new "errors" because of some line number changes, but I'll squelch them going forward. > IIRC, doing something like that can (sometimes?) still get you into > undefined behaviour territory, so the compiler could potentially > "optimize" away the later NULL check. So I did just go and check the generated code for each of these cases and gcc didn't elide the subsequent if-test, at least on x86-64 and my compiler / build config. Given http://lwn.net/Articles/342330, it seems possible, though. -- Bob Copeland %% http://bobcopeland.com/ _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k
next prev parent reply other threads:[~2016-06-13 13:05 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-06-10 12:52 [PATCH] ath10k: fix potential null dereference bugs Bob Copeland 2016-06-10 12:52 ` Bob Copeland 2016-06-13 5:39 ` Michal Kazior 2016-06-13 5:39 ` Michal Kazior 2016-06-13 9:08 ` Johannes Berg 2016-06-13 9:08 ` Johannes Berg 2016-06-13 13:05 ` Bob Copeland [this message] 2016-06-13 13:05 ` Bob Copeland 2016-06-13 13:18 ` Johannes Berg 2016-06-13 13:18 ` Johannes Berg 2016-06-14 13:51 ` Valo, Kalle 2016-06-14 13:51 ` Valo, Kalle 2016-06-14 14:16 ` Bob Copeland 2016-06-14 14:16 ` Bob Copeland 2016-06-14 14:39 ` Valo, Kalle 2016-06-14 14:39 ` Valo, Kalle 2016-06-14 13:53 ` Valo, Kalle 2016-06-14 13:53 ` Valo, Kalle 2016-06-30 10:54 ` Kalle Valo 2016-06-30 10:54 ` Kalle Valo
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=20160613130507.GA11074@localhost \ --to=me@bobcopeland.com \ --cc=ath10k@lists.infradead.org \ --cc=johannes@sipsolutions.net \ --cc=linux-wireless@vger.kernel.org \ --cc=michal.kazior@tieto.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.