From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Daniel Wagner <daniel.wagner@siemens.com>
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org,
Andrey Ryabinin <aryabinin@virtuozzo.com>,
Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH 4.4] net/mac80211/debugfs.c: prevent build failure with CONFIG_UBSAN=y
Date: Wed, 10 Jan 2018 13:16:33 +0100 [thread overview]
Message-ID: <20180110121632.GC12483@kroah.com> (raw)
In-Reply-To: <20180109115327.22180-1-daniel.wagner@siemens.com>
On Tue, Jan 09, 2018 at 12:53:27PM +0100, Daniel Wagner wrote:
> From: Andrey Ryabinin <aryabinin@virtuozzo.com>
>
> commit 68920c973254c5b71a684645c5f6f82d6732c5d6 upstream.
>
> With upcoming CONFIG_UBSAN the following BUILD_BUG_ON in
> net/mac80211/debugfs.c starts to trigger:
>
> BUILD_BUG_ON(hw_flag_names[NUM_IEEE80211_HW_FLAGS] != (void *)0x1);
>
> It seems, that compiler instrumentation causes some code
> deoptimizations. Because of that GCC is not being able to resolve
> condition in BUILD_BUG_ON() at compile time.
>
> We could make size of hw_flag_names array unspecified and replace the
> condition in BUILD_BUG_ON() with following:
>
> ARRAY_SIZE(hw_flag_names) != NUM_IEEE80211_HW_FLAGS
>
> That will have the same effect as before (adding new flag without
> updating array will trigger build failure) except it doesn't fail with
> CONFIG_UBSAN. As a bonus this patch slightly decreases size of
> hw_flag_names array.
>
> Signed-off-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: "David S. Miller" <davem@davemloft.net>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
> [Daniel: backport to 4.4.]
> Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
> ---
>
> Hi,
>
> The only stable tree which is missing this fix is 4.4. 4.1 doesn't
> have 30686bf7f5b3 ("mac80211: convert HW flags to unsigned long
> bitmap") which makes gcc unhappy with allmodconfig. 4.9 contains the
> fix.
Now queued up, thanks for the backport.
greg k-h
prev parent reply other threads:[~2018-01-10 12:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-09 11:53 [PATCH 4.4] net/mac80211/debugfs.c: prevent build failure with CONFIG_UBSAN=y Daniel Wagner
2018-01-10 12:16 ` Greg Kroah-Hartman [this message]
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=20180110121632.GC12483@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=aryabinin@virtuozzo.com \
--cc=daniel.wagner@siemens.com \
--cc=davem@davemloft.net \
--cc=johannes@sipsolutions.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.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).