Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753123AbbLCTSM (ORCPT ); Thu, 3 Dec 2015 14:18:12 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35667 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbbLCTSI (ORCPT ); Thu, 3 Dec 2015 14:18:08 -0500 MIME-Version: 1.0 In-Reply-To: <1449162322.31265.2.camel@sipsolutions.net> References: <1449157807-20298-1-git-send-email-aryabinin@virtuozzo.com> <1449157807-20298-3-git-send-email-aryabinin@virtuozzo.com> <1449162322.31265.2.camel@sipsolutions.net> Date: Thu, 3 Dec 2015 22:18:05 +0300 Message-ID: Subject: Re: [PATCH v4 2/3] mac80211: Prevent build failure with CONFIG_UBSAN=y From: Andrey Ryabinin To: Johannes Berg , Andrew Morton Cc: Andrey Ryabinin , LKML , linux-wireless@vger.kernel.org, "netdev@vger.kernel.org" , "David S. Miller" , Peter Zijlstra , Sasha Levin , Randy Dunlap , Rasmus Villemoes , Jonathan Corbet , Michal Marek , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Yury Gribov , Dmitry Vyukov , Konstantin Khlebnikov , Kostya Serebryany , "x86@kernel.org" , "open list:DOCUMENTATION" , "open list:KERNEL BUILD + fi..." Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1409 Lines: 34 2015-12-03 20:05 GMT+03:00 Johannes Berg : > 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/