Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1401390lqd; Thu, 25 Apr 2024 14:41:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUW2yorjy9WbWV2G0TR1ZwOC+psW1JZ0ASK1n4nP/dKT0yggMvY/mGwcXAa4mEt91cx8muTiTr54ZvK06LmDUT2ghSTEfIHPzhQkZpEdw== X-Google-Smtp-Source: AGHT+IF1KRRyHYbyhydAgzCA6A6lLxIQYE9I7MM5/wboZ7vyAkswoSYI/NEdmyCmoWDcFullMlMy X-Received: by 2002:a17:903:124e:b0:1e2:96d3:1bc1 with SMTP id u14-20020a170903124e00b001e296d31bc1mr1086806plh.1.1714081274104; Thu, 25 Apr 2024 14:41:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714081274; cv=pass; d=google.com; s=arc-20160816; b=pz9Z/GZFcqhkM8Cebaq4jPxXuUbuD//8ojw/xqgXSwbEQkwL4psjF/EgGX5W6KsX0Y L/OCIxRTHwXJj4Tb/Qz3T6oukcNfgR6jujefEhMx8i15H/xyyrNRmjx89bCi1Zjdsbxr RiMTK6HpweoesZT1u/fb66t0IoCvlMQOS06soSQM5Byutm5nyKyRZ03pSPhaYbF8kUj9 IQaGQqO4SVWR0bBRtx1F094XS59F9M3mPhjGQmR3mMP2nfpx7EaAjUCYJEUqeJABNu+1 Bl+hnkf51YyPZnuZ1mbLKbwkmwp6STjkCml4V/bFsR1moazT9MV8NU8Li5Tui3gqFIOn wqVA== 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=qI5CW5tTCBmT5vR6LfFWWlomHuG2StXedKufsh2Xck8=; fh=ST/RBTTKdwYr42IhoXq9PA/gyfk5kSFwOABWG3Pk0zI=; b=GnuQzOlDwk8Dzx7il45UAPKLZZHB+r6T6u8fTRzgI+k9s3BvJt1R3PjfpWpVuOhDXC 2MbjSkGnadSxm6wrxIpJpPR7X8gmgmRkYFquahPJ1sjJmQY8xBJlt3MhGvhqrfSLQ451 mIBFgBLcSWs/yuPd2sCnCBJL+jeVO6BK5ESqQ6C79klsjxN1iSkdjt51gPxB0RAWB++x 0JfxcOY8eGRUTRfltXc7Tah0upAZlnCS4d55c8XWQ/oewBGokeySl5IgPVBIoI5nL1Qg xWxXT2eyDB7JSrV4iAPTYzrfqH7okuplqrX1MhHksvZ/UCrums572pZkyycfM0RmwwcN vpeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=HIApaua1; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-159228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159228-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id me6-20020a170902fc4600b001e503e6dbc3si13856646plb.648.2024.04.25.14.41.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 14:41:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=HIApaua1; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-159228-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159228-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B0550280A99 for ; Thu, 25 Apr 2024 21:41:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAA1B156677; Thu, 25 Apr 2024 21:38:44 +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="HIApaua1" 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 005ED156645; Thu, 25 Apr 2024 21:38:43 +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=1714081124; cv=none; b=BD+7hKVQ2z+1PE8VpSceOr00zjSETIuVAnd58mQaSbYdwD3FTJf8kRqXQkIOXML/lPK7vDl+gS4nXIg5gBIERi+BiAIVrsN83FjDeiVxivmn3iFtSZDn0PO9FVeX32/cXrv513/oHWjGD9PWJlJmLD0MEXPdW8YpBOfUhu7ajwk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714081124; c=relaxed/simple; bh=c/w30T3d2xLjoPV7BOj7cdIM3uDt5brThstTtJMw1qw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=eVWREov6IcO76Q9TN5lmIqAx2l0aWd1Xf/sTKa71FeGkxQpvZ0g1GTR5EyqTR7FkGuwCsvORrh2qnrNDi78tutCpkqvVjgB/YWGy7KiE+oSj73nhG6FYidwqgjRx4MEC8bRGe/Cs7EFz3jJwSL9KIIjH/0bD+xVaYIODF46f85k= 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=HIApaua1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49ECCC113CE; Thu, 25 Apr 2024 21:38:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1714081123; bh=c/w30T3d2xLjoPV7BOj7cdIM3uDt5brThstTtJMw1qw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HIApaua1Lra3WV8XfIDrQSiFAgLFluP6pDWigAGa+kys+mss6Iar5kIVbzQv4MGFC PXHzGlBiBpU2dHYpxJcvCKdIQUpIuljiylgUK4Gke54aTMqZAVAbWzyWxVm3nxNVgO uC3RQrfd4XIvRR2eZJK0bW4GTZhD55zJ93BFXebs= Date: Thu, 25 Apr 2024 14:38:42 -0700 From: Andrew Morton To: Suren Baghdasaryan Cc: Kent Overstreet , Matthew Wilcox , Kees Cook , 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: <20240425143842.fe54147e4073c7d5e8b48d7b@linux-foundation.org> In-Reply-To: References: <20240425200844.work.184-kees@kernel.org> <64cngpnwyav4odustofs6hgsh7htpc5nu23tx4lb3vxaltmqf2@sxn63f2gg4gu> 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 14:21:39 -0700 Suren Baghdasaryan wrote: > > > > 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. > > Yeah, that would preclude some nice usecases. Could we maybe use > CAP_SYS_ADMIN checks instead? That way we can still use it from a > non-root process? I'm inclined to keep Kees's 0400. Yes it's a hassle but security is always a hassle. Let's not make Linux less secure, especially for people who aren't even using /proc/allocinfo. If someone really wants 0666 then they can chmod the thing from initscripts, can't they?