Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1385977lqd; Thu, 25 Apr 2024 14:05:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUfPbIIhsIXPMzoLBuxK91lr1AqPQZIZUzA+tLrCuyzG/YVZ5dYX18Bf9TiSPc1GQ3HJS7W2YvtkxNgqwyyJFcdlClNXDMm2W4nn777Aw== X-Google-Smtp-Source: AGHT+IHJq3dZItr5iYgWbm40KiNMG6xUQCrOgWhbImulE+3GzL5P/VkE0knIC3YH3yAK+xMt8suj X-Received: by 2002:a05:6102:75c:b0:47b:d23d:281a with SMTP id v28-20020a056102075c00b0047bd23d281amr734616vsg.30.1714079101448; Thu, 25 Apr 2024 14:05:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714079101; cv=pass; d=google.com; s=arc-20160816; b=lq/nBw9QasloqmNg4f0hrOp/Rv78fPJpBCnt7ORaiZec5t4RW1i/tu3GhYPkoUsxX5 xBhGASsLmGtmQ6Wz2pqlaWfFUSfdJnosAutqNkfxJvUWl5vxtFme78MBI+xwMMzQgu0A xl2TXyD0ast/LpcdgQz5eAbYM879icWtUaNUPD20NiL+T2NYJ6nTlo2Eef74DfBOgItJ yc1HJciyesjGhM26GA/Tv0WQXLwXfLmTCM/H8N+OQiuz3icmtYng6x1m8uRG9LDvZRLz u1F1bKxh4CJmUgxWZ8BKU5XrOBScJaLED5rKEB8TlQBbofpMQU6zBAFcuwnCvWvtCjfz h0xQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:date; bh=VklnmrM/oloTOZKNCrwIWgMU+XqIMz0SMCJXUZUJzsM=; fh=QsZNyu5s4SSj0YVH/opkbMC1UEJtPx0e2JUDK1NQAVA=; b=JAJhwPHdEQm9i47idQAAYxbntXzhtubC9Sa1XNma5755ZYk0pHFtCvENMlmd7+cy4y VHx+ryxIXUQnZ/0MoWybpSByPY0/z1Sawv1ANLwDWZvsmLbXxYAUmL3PsSrv95L5LZDR TAWW+qgG/9f1iyKY4byoKido3BmVOrbdhsl5yZYewiOwQNJzo5wdiZHDEFuzW1lOs5zr ipLNFQXAXanWlbJNT8FXJGdAt0wraj9fKaYnPfix33kHj/arkM9CIf5vmh8qHnG1o2qe Fk9NfAnErK9w9/cKlBl+MvMVurJESetE6Pk6vqDF+Zxw4XT+LguL8J6ZGc88uj8BnYKN mmNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=s1VhBEb1; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-159182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id hz1-20020a0561024a8100b0047be88cae8bsi2249994vsb.762.2024.04.25.14.05.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 14:05:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=s1VhBEb1; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-159182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 196351C22B27 for ; Thu, 25 Apr 2024 21:05:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2EAA7155336; Thu, 25 Apr 2024 21:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="s1VhBEb1" Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (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 F32A7152E13 for ; Thu, 25 Apr 2024 21:04:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714079094; cv=none; b=tnnYnJjGas2ZaQ5N2iiAK//H3MDvVdJ90qR1td4zLFcbUNTwq/+IMuVsLRpswxDi0esJE93MpR/2CGNML52niBQEvaMOWAAs97J6VsHHX+2d36pa8on16dfItprzers3e+YX9zhReEj9EEdeVgAexxBUvfYJSyAlLbW70f30D4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714079094; c=relaxed/simple; bh=Nu0VY0jwpK1DX56a0LyK3/k7gCJhFBWD17UiCPPfiM0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tEdoZ5FJK8aY64K3L5A/CKQYfKyEsQm7Q+r5WsivQ8eZy0BThJ5UOZGVDRHCR/sbMP8vuyTYKUlJSFIMD5OnVOyPF2Dg6YjjRISCjubWsIhh5FKMpcMXDC4p7/p6SAZ7MOcUKb47E/257MdO6AkMimWvhxQz6+A2wI6lDpzyTFw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=s1VhBEb1; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Date: Thu, 25 Apr 2024 17:04:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714079091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VklnmrM/oloTOZKNCrwIWgMU+XqIMz0SMCJXUZUJzsM=; b=s1VhBEb1oCQ6MjYq3v8dmqur48xfAGo5Bo39s4wNorebzmH6gvf2V7i0tet2AM0MLF0RJ+ RPfAIodbT0oZlE3tTViJVpCPHYbZQ0OrjfrIlr7kNApAQS7i1wurRUqchGHzGBQAPWnWw0 Ia5a2fXMLZd9ZM5wUE+MOVK2tP5y/rU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Matthew Wilcox Cc: Kees Cook , Suren Baghdasaryan , Andrew Morton , 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: <64cngpnwyav4odustofs6hgsh7htpc5nu23tx4lb3vxaltmqf2@sxn63f2gg4gu> References: <20240425200844.work.184-kees@kernel.org> 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-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT On Thu, Apr 25, 2024 at 09:51:56PM +0100, Matthew Wilcox wrote: > On Thu, Apr 25, 2024 at 04:45:51PM -0400, Kent Overstreet wrote: > > On Thu, Apr 25, 2024 at 01:08:50PM -0700, Kees Cook wrote: > > > The /proc/allocinfo file exposes a tremendous about of information about > > > kernel build details, memory allocations (obviously), and potentially > > > even image layout (due to ordering). As this is intended to be consumed > > > by system owners (like /proc/slabinfo), use the same file permissions as > > > there: 0400. > > > > Err... > > > > The side effect of locking down more and more reporting interfaces is > > that programs that consume those interfaces now have to run as root. > > sudo cat /proc/allocinfo | analyse-that-fie Even that is still an annoyance, but I'm thinking more about a future daemon to collect this every n seconds - that really shouldn't need to be root. And the "lock everything down" approach really feels like paranoia gone too far - what's next, /proc/cpuinfo? Do we really want to go the Windows approach of UAC pop ups for everything? I'd rather be going the opposite direction, of making it as easy as possible for users to see what's going on with their machine. Instead, why not a sysctl, like we already have for perf? The concern about leaking image layout could be addressed by sorting the output before returning to userspace.