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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=unavailable 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 7573BC31E5D for ; Tue, 18 Jun 2019 09:18:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5875F2133F for ; Tue, 18 Jun 2019 09:18:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729413AbfFRJSU (ORCPT ); Tue, 18 Jun 2019 05:18:20 -0400 Received: from foss.arm.com ([217.140.110.172]:58798 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729137AbfFRJSU (ORCPT ); Tue, 18 Jun 2019 05:18:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D19DC344; Tue, 18 Jun 2019 02:18:18 -0700 (PDT) Received: from e103592.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2BBBB3F246; Tue, 18 Jun 2019 02:18:14 -0700 (PDT) Date: Tue, 18 Jun 2019 10:18:12 +0100 From: Dave Martin To: Kees Cook Cc: Catalin Marinas , Mark Rutland , kvm@vger.kernel.org, Christian Koenig , Szabolcs Nagy , Will Deacon , dri-devel@lists.freedesktop.org, Kostya Serebryany , Khalid Aziz , Lee Smith , linux-kselftest@vger.kernel.org, Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Jason Gunthorpe , Dmitry Vyukov , Evgeniy Stepanov , linux-media@vger.kernel.org, Ruben Ayrapetyan , Andrey Konovalov , Kevin Brodsky , Alex Williamson , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Greg Kroah-Hartman , Felix Kuehling , linux-kernel@vger.kernel.org, Jens Wiklander , Ramana Radhakrishnan , Alexander Deucher , Andrew Morton , enh , Robin Murphy , Yishai Hadas , Luc Van Oostenryck Subject: Re: [PATCH v17 03/15] arm64: Introduce prctl() options to control the tagged user addresses ABI Message-ID: <20190618091811.GC2790@e103592.cambridge.arm.com> References: <20190613110235.GW28398@e103592.cambridge.arm.com> <20190613152632.GT28951@C02TF0J2HF1T.local> <201906132209.FC65A3C771@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201906132209.FC65A3C771@keescook> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Thu, Jun 13, 2019 at 10:13:54PM -0700, Kees Cook wrote: > On Thu, Jun 13, 2019 at 04:26:32PM +0100, Catalin Marinas wrote: > > On Thu, Jun 13, 2019 at 12:02:35PM +0100, Dave P Martin wrote: > > > On Wed, Jun 12, 2019 at 01:43:20PM +0200, Andrey Konovalov wrote: > > > > +static int zero; > > > > +static int one = 1; > > > > > > !!! > > > > > > And these can't even be const without a cast. Yuk. > > > > > > (Not your fault though, but it would be nice to have a proc_dobool() to > > > avoid this.) > > > > I had the same reaction. Maybe for another patch sanitising this pattern > > across the kernel. > > That's actually already happening (via -mm tree last I looked). tl;dr: > it ends up using a cast hidden in a macro. It's in linux-next already > along with a checkpatch.pl addition to yell about doing what's being > done here. ;) > > https://lore.kernel.org/lkml/20190430180111.10688-1-mcroce@redhat.com/#r Hmmm, that is marginally less bad. Ideally we'd have a union in there, not just a bunch of void *. I may look at that someday... Cheers ---Dave