Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1452485lqd; Thu, 25 Apr 2024 16:47:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUeXOdsaxr1z/8VqmoLF7MVcchN0zoC30YwIHaNtbFpJoNSIibelGj6bVFEw2FnNfdizm6ZR7sjR9l9LpdpGtV41gfOaJ7r0XNeGV1++A== X-Google-Smtp-Source: AGHT+IG42lT2JDo63oS5mMZi+np78msqmeuSHz4CjMAycEnABAwdDZWZNq2OqWjrejjsM8E/HZH+ X-Received: by 2002:a17:902:ce12:b0:1e0:157a:846c with SMTP id k18-20020a170902ce1200b001e0157a846cmr1389616plg.55.1714088850460; Thu, 25 Apr 2024 16:47:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714088850; cv=pass; d=google.com; s=arc-20160816; b=vNLyZYhn/3ek4SkTWePeGrnSJAA/zSD4n8RiGAQ4VGtxyO0w8EYPKK290IfkyTJdrz ZX7PRupzAbdm3joshD0pcrMJGsEdYqJt75zuEhOqnBa7+K3axZGSZ+NR3R+rv4rpDz9i tG8xhrHFd/hN/vVh2UGl4jS4il+gkf0KVaxZgqTxMI+55bP/YniYeIxyzCsi9VsvMC8S Ppu8HqROCYB4UibYCQ1DGWxTA4MwovhiJxbBcWizyknqIeiQo03VDKnV3pjQpdmgIAi9 GAqKl09vJmYtsYWIuimIp6BbehV7DDXc8n64SKgx8uC7CklreuINzevhm0Qi1CJvHb64 3k6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=YPWhJpQ9rZooPHNvvpdVpo8UKkB33RxbkL7GF+fK2eA=; fh=AB8v35nk+tfUlERCfcA7E4z1t4YTq6UK68LPfhh5PR0=; b=klbff9HOIXob6rp3QobfJb0NtCz9bYjifAQyLvB1ZPdht+n38sJhdvRKvJqt66gCGa 26FTjTkVM5ae7j8EHLve+pwkz/fwKt2mUhu5X+SEgrMeLph1Sx907x1dm/vwcJvld6Jt lYXVpWAmyEWGlWZFOqeo78RuXRYFfvu55e0m+WOUhP8ZrFjXVLds0BwKYnzjwWplL9Iv FpWloYjcAyUjzKwDv3OOx9bprGAl63gDbDcVR3LxTdTwmGHlIN2Hdl4m/+2S6G3rL9nR CswZwZkOFzbPYllqaDK8307A5ALjbkhXdbpKFyd0NApx2VapCT2vZgPSJ3UAiDN2gxUf ls6Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=YEheUZTh; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-159366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159366-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d20-20020a170902b71400b001e463bd62desi13731032pls.435.2024.04.25.16.47.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 16:47:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=YEheUZTh; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-159366-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159366-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 174DFB21132 for ; Thu, 25 Apr 2024 23:47:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D281156992; Thu, 25 Apr 2024 23:47:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="YEheUZTh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E87B014E2EF; Thu, 25 Apr 2024 23:47:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714088840; cv=none; b=MGZzgu2vqTqlFrhYzXccjgyulEjeFsgdOaeliIcz3P0YKTS68NJG6Wl9UJRCteOoaK3O47JBUJU6fzHhNmefPmOEj/nLpwbzYkPY/LCujQfvwAK4llQ/Km5yv+ftxk1kiH9khGlzMDV2zYvfkMe2kiO6hIhsmCPRO7OD8XPTMPo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714088840; c=relaxed/simple; bh=beAuVYStInSqKxnLk3E/kVyZbTYG4nix+yBzCApaJDE=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=ShiRzrx8lgtc0XxH1+VenGSO2w9betFX8hylwGvEltPdghKkZkJR6HsadIoWIZS9DkRZVYrzuR3dmTRxd+QDEifWbRrxVhVRgI3NB+4kOmAGiWM1b0WoCb5/N4V6tj4KSGMbrkcms38mKiywtu5OAHD0kUhSiyHlP2SNHGhgCxY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=YEheUZTh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2102FC113CC; Thu, 25 Apr 2024 23:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1714088839; bh=beAuVYStInSqKxnLk3E/kVyZbTYG4nix+yBzCApaJDE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=YEheUZThVQmfzJ+cH66dpEmbGfQvhm2WHLxdoorIxuxKL/2z1s5iFoXnh7sMjkCDh vPzE0Ppm0ZZMYyp5msXChAJq9xRrdbLEeS6ODAb0ttQzkvmtk09NiOq8pyzxzs01IF HF9ukneK6b5kQgqee9SDb/kWWL4Y4+C41KBEi1o4= Date: Thu, 25 Apr 2024 16:47:18 -0700 From: Andrew Morton To: Kees Cook Cc: Kent Overstreet , Matthew Wilcox , Suren Baghdasaryan , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] alloc_tag: Tighten file permissions on /proc/allocinfo Message-Id: <20240425164718.e8e187dd0c5b0a87371d8316@linux-foundation.org> In-Reply-To: <202404251532.F8860056AE@keescook> References: <20240425200844.work.184-kees@kernel.org> <64cngpnwyav4odustofs6hgsh7htpc5nu23tx4lb3vxaltmqf2@sxn63f2gg4gu> <202404251532.F8860056AE@keescook> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 25 Apr 2024 15:42:30 -0700 Kees Cook wrote: > > The concern about leaking image layout could be addressed by sorting the > > output before returning to userspace. > > It's trivial to change permissions from the default 0400 at boot time. > It can even have groups and ownership changed, etc. This is why we have > per-mount-namespace /proc instances: > > # chgrp sysmonitor /proc/allocinfo > # chmod 0440 /proc/allocinfo > > Poof, instant role-based access control. :) Conversely, the paranoid could set it to 0400 at boot also. > I'm just trying to make the _default_ safe. Agree with this. Semi-seriously, how about we set the permissions to 0000 and force distributors/users to make a decision.