From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35929C2D0CE for ; Fri, 24 Jan 2020 22:00:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 049312072C for ; Fri, 24 Jan 2020 22:00:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="XxSKomYe" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728205AbgAXWAZ (ORCPT ); Fri, 24 Jan 2020 17:00:25 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:48208 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725821AbgAXWAZ (ORCPT ); Fri, 24 Jan 2020 17:00:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EHG6Q1AO3iuT6O0CXN+hQkY2MviKsXG45P08g3eUA9c=; b=XxSKomYe9qO2pHUJ4g7F1egF8 OgnONfKVG8tW+PkImifBcGdo/lXupljgt8slZrTeik8u+eSsfMIX4CAjPc/XYd9ZMc/mUp7LmrTwb JpdAJulhZ0CABJTU5zKI6ou6Snfxih/bM1V77We8ZJEYde4+fRZHEG8BssTOsmQnR4r2SHln/Jqnm Ao/GbN7p1DZYOss+cgDc3U9lY4V1k4suTJ4TVEAIwB+g3tREepaqhkTix0x1XrWnv5YNZ+MpyR2wx uoI66X9rt1Hhf5zPqMHqJ/zbpTZRhHQh6bjKa7eLmrHwyM1vp/TGXp+f0igWG7iRvAwizy04Dx42w ljPPZs2aA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1iv6zr-00014k-16; Fri, 24 Jan 2020 22:00:11 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 316FF980E48; Fri, 24 Jan 2020 23:00:08 +0100 (CET) Date: Fri, 24 Jan 2020 23:00:08 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: Nick Desaulniers , Will Deacon , LKML , linux-arch , kernel-team , Michael Ellerman , Segher Boessenkool , Christian Borntraeger , Luc Van Oostenryck , Arnd Bergmann , Peter Oberparleiter , Masahiro Yamada , Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" Subject: Re: [PATCH v2 02/10] netfilter: Avoid assigning 'const' pointer to non-const pointer Message-ID: <20200124220008.GS11457@worktop.programming.kicks-ass.net> References: <20200123153341.19947-1-will@kernel.org> <20200123153341.19947-3-will@kernel.org> <20200124082443.GY14914@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 24, 2020 at 09:36:54AM -0800, Linus Torvalds wrote: > On Fri, Jan 24, 2020 at 12:25 AM Peter Zijlstra wrote: > > > > Just for curiosity's sake. What does clang actually do in that case? > > This shouldn't necessarily be clang-specific. If the variable itself > is 'const', it might go into a read-only section. So trying to modify > it will quite possibly hit a SIGSEGV in user space (and in kernel > space cause an oops). Quite; but I worried clang would use the UB to omit the access entirely, and therefore rob us of the well deserved crash or something. Let me go read Nick's email tho, see what it actually does.