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


Groups > linux.kernel > #1283272

Re: [PATCH v4 2/3] mac80211: Prevent build failure with CONFIG_UBSAN=y

From Andrey Ryabinin <ryabinin.a.a@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/3] mac80211: Prevent build failure with CONFIG_UBSAN=y
Date 2015-12-03 20:20 +0100
Message-ID <qBHA5-Ns-11@gated-at.bofh.it> (permalink)
References <qBEsy-75q-3@gated-at.bofh.it> <qBEsz-75q-33@gated-at.bofh.it> <qBFyj-80z-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2015-12-03 20:05 GMT+03:00 Johannes Berg <johannes@sipsolutions.net>:
> On Thu, 2015-12-03 at 18:50 +0300, Andrey Ryabinin wrote:
>> 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.
>>
> Seems fine, would you want to take it through some other tree together
> with UBSAN, or do you expect that to still take long enough to allow
> this to trickle through our trees?
>

I expect that Andrew will take it with UBSAN for 4.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v4 0/3] UBSAN: run-time undefined behavior sanity checker Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-12-03 17:00 +0100
  [PATCH v4 2/3] mac80211: Prevent build failure with CONFIG_UBSAN=y Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-12-03 17:00 +0100
    Re: [PATCH v4 2/3] mac80211: Prevent build failure with  CONFIG_UBSAN=y Johannes Berg <johannes@sipsolutions.net> - 2015-12-03 18:10 +0100
      Re: [PATCH v4 2/3] mac80211: Prevent build failure with CONFIG_UBSAN=y Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-12-03 20:20 +0100
  Re: [PATCH v4 0/3] UBSAN: run-time undefined behavior sanity  checker Andrew Morton <akpm@linux-foundation.org> - 2015-12-05 01:40 +0100
    Re: [PATCH v4 0/3] UBSAN: run-time undefined behavior sanity checker Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-12-07 17:50 +0100
    Re: [PATCH v4 0/3] UBSAN: run-time undefined behavior sanity checker Andrey Ryabinin <aryabinin@virtuozzo.com> - 2015-12-10 16:50 +0100

csiph-web