Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp536289ybi; Thu, 13 Jun 2019 22:16:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyXzKilfYSUIUsYd6iHTXYecOfjbAxLTMdT1RLqHCf3GcotscYOEHapf3kvznvg1VZ+9ex8 X-Received: by 2002:a63:2848:: with SMTP id o69mr33947329pgo.258.1560489373892; Thu, 13 Jun 2019 22:16:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560489373; cv=none; d=google.com; s=arc-20160816; b=ilZ5zeI5qV6sv+CAzU6V4ka2QHF1ghz7Zgei5wnRWtPIZi9Q/9+fEFgqtgWFpudgwk ODpCnym6eWJYzganhsT61+zqEiRlnSBfqEr0wMhsSht/8IBAY7R8NkK+zRFxfa+SYVqp DyzIwIt9WD9422iqcPH4C8HkUFjpDGl7Umzg9tisS5Yk16zH0IBMLLdF+AO/+vnLGxAq SMfW64iG37ljum/oiyxKjCN46hBRnAtgkwP75BnlHhUpjPrFQ+blEI/1zyn7TgES/PNq Ha/EOg4hot7xh1hKpvXDd8xparspI/9Wp2OL09zdXkKiPWIwIZrjaWYIIbSWchUsVYGi V3JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7L7uajw4KCsbL/S4E35UjNUKEFnxH/l2jD/CiFHPlB4=; b=qpyvDZfZ8tniYaJ7kyHYb6z6cgFwY73SIXbouOoess/ZlrOXySjnsoBoDBcBeVLT29 uV1CoDz21/2Pc5VnSU9oG+67PY1wLDt+jc8yA8N3KSDZYp6/UxNlebuGvzzsuNj0K16n wMfzPIoWsXc8MF7vwVWCGZlR8YN2vsfCJoW+Ik8mlnQmqCI2WqdTU8i0bqwVo0ipuHIi pjfSadHi7ivylT4Ys3ecaOQwVrRI+uIUj9CrzQ23Iy0oyg01xY8I3P3rJJfZhKrPtrhv +yxVpn6GxMkxrHX/oGMPzKzxtWokbFYzp9p/j/fnGL0z5KYdZBVhwmlFogzMRfpH4nkJ wytA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iVgLfh3u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e19si1319679pjp.49.2019.06.13.22.15.57; Thu, 13 Jun 2019 22:16:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iVgLfh3u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726011AbfFNFN5 (ORCPT + 99 others); Fri, 14 Jun 2019 01:13:57 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41962 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbfFNFN5 (ORCPT ); Fri, 14 Jun 2019 01:13:57 -0400 Received: by mail-pf1-f196.google.com with SMTP id m30so667540pff.8 for ; Thu, 13 Jun 2019 22:13:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7L7uajw4KCsbL/S4E35UjNUKEFnxH/l2jD/CiFHPlB4=; b=iVgLfh3u2rK3LSidDHhJBtdtNtpSlz4dIEb1BDsj4Re2fjkTLPAq5VHIrDbtF7rfc6 5a9vwqPeA/oCez/a3NCM+60PRvHQV0ltptm4u18TbaZDEEEiYlVGWcXj0ugZtZMkqFnM ltnmFCb7F68lK6w+sv8Frqic/ZXdf9np/Ivm0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7L7uajw4KCsbL/S4E35UjNUKEFnxH/l2jD/CiFHPlB4=; b=KcB+gT9LZFW0x3fwUovEBP/ohFQb6oEIT+wWg5gF+h0iv8pvGmxBMX4tZ2LVYd6Q5g bac1CrcnJwf7W5Yz98RDg6CkH37wegzYZbtmbVQQZSoDmwu0KZsc8YGtCHAuHNSirCog 6ilhBA9lRgRGyy0r+1enhQblxPzKDikkpZL9Pv571bknbynjv2n29BaW+yTS0NQ3mCeG Wswl4J/5UT2B1pAXZ5Z9UNxzJcqLirvQrdhObiEF1KBMEyePtAJtQNz3lf8z4XTPJydY aqskb8+Cz+Kd7DBl4wHJ5djv/KZ5rBVKEB71NYi1QKkeoAC+kalTipprueT4Z37KEgz6 J8Ew== X-Gm-Message-State: APjAAAV6d89oCenaep/HOghguxKsAJVK5hx0YrTq9x2T7eQ8cgzLzs08 B0Dc/TP20If/A16VArcVH0QZtg== X-Received: by 2002:a63:6948:: with SMTP id e69mr23166361pgc.441.1560489236782; Thu, 13 Jun 2019 22:13:56 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id f13sm1417022pje.11.2019.06.13.22.13.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 13 Jun 2019 22:13:55 -0700 (PDT) Date: Thu, 13 Jun 2019 22:13:54 -0700 From: Kees Cook To: Catalin Marinas Cc: Dave Martin , Andrey Konovalov , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Rutland , Szabolcs Nagy , Will Deacon , Kostya Serebryany , Khalid Aziz , Felix Kuehling , Vincenzo Frascino , Jacob Bramley , Leon Romanovsky , Christoph Hellwig , Jason Gunthorpe , Evgeniy Stepanov , Kevin Brodsky , Ruben Ayrapetyan , Ramana Radhakrishnan , Alex Williamson , Mauro Carvalho Chehab , Dmitry Vyukov , Greg Kroah-Hartman , Yishai Hadas , Jens Wiklander , Lee Smith , Alexander Deucher , Andrew Morton , enh , Robin Murphy , Christian Koenig , Luc Van Oostenryck Subject: Re: [PATCH v17 03/15] arm64: Introduce prctl() options to control the tagged user addresses ABI Message-ID: <201906132209.FC65A3C771@keescook> References: <20190613110235.GW28398@e103592.cambridge.arm.com> <20190613152632.GT28951@C02TF0J2HF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190613152632.GT28951@C02TF0J2HF1T.local> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- Kees Cook