Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp1403687lqd; Thu, 25 Apr 2024 14:47:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUq8WOSU8OQaVwYBHfazKB3RUESkvc3Gze4XGsgbBB3KoDHCnkIrZtilWidZeWxVxL6hItW/nns/9yoT1jCfv3ZIHAjQRQVDQzg9rGZdQ== X-Google-Smtp-Source: AGHT+IHqXF+JwiswP5AzKhqRmlbrGUXHvF+1lzidnoGn2qJ0xfPK+hFkeLo7VoqlXULgYg5mbvL1 X-Received: by 2002:a05:622a:254:b0:43a:1376:a9ea with SMTP id c20-20020a05622a025400b0043a1376a9eamr815574qtx.27.1714081636337; Thu, 25 Apr 2024 14:47:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714081636; cv=pass; d=google.com; s=arc-20160816; b=QI+nYWqiEHw5wGNyjlJ2zBoDUGGxl6h2ns5flDs/TG5sN54SgSROkLmgakD/BdstWe uXa/8+TVI3EFHUCwqfVDS8HrkvDup8+xN9+gPhWfmKNz55FBHVwvaqpvIUGNpKmF3W0f yKKwF+jGog4M7TURDpgTiKPJT0BAa9FNE29dq0wpG55K70SmG7s3pj6nyld3JukzmFey 7kSH1cmtp0eDu2zJNsc5TCs1yd+tBGHxDJ65X6nSPgpzm+rIKnnA51tDGSioRLoNk7uV ND1RDWLvVQoCrQo8LCn20J00EygOs8oPtZlOCNGnDqQLKBJCRdZPjgnp1PJWd3Ab+uW4 n9VA== 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=gojPkHBBYhfHH8Nts+6nokM2SWbYB22brKZh/DHHIWE=; fh=IAyk/RwMvMry4W8hNlpFHY+0ZQ9O2r56LxaV4a1VWqI=; b=VZcgJcBVRWQdXeAOnxC1CmeR+Sw11hhDeEejIPIXfHCQ1XSo4CVv5EYs+5yPUoioU7 4+QUXeg1ZePcRlbVHP41l0+Zb593NViArCSjyWbgGlTeY/D85+PtaDvgkTi9c3XqVvMD IfcUxReRR8EkD4q3FCczyh7731wNiHa1M00zD9DBCxubSNqcly3O2Kfc0Z03BhDkRwDx UwcIfa1KVFBlA7MA0vFZCw8bzI2lTqNzDL1xfX3ZXRE6mX9XT0NFWY94ucvRHTnsN84e JyL5ULFGLov/BKHj+aMKGRdR35ePFZ5ORFrbl5bhtMRz7esuOoF4sei9Vwm7kGIZ1225 auQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="PavWTYF/"; 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-159240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159240-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 gc9-20020a05622a59c900b004399a5b96dasi11824244qtb.248.2024.04.25.14.47.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 14:47:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159240-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="PavWTYF/"; 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-159240-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159240-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 B45141C234BF for ; Thu, 25 Apr 2024 21:47:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69C4A156643; Thu, 25 Apr 2024 21:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PavWTYF/" Received: from out-171.mta0.migadu.com (out-171.mta0.migadu.com [91.218.175.171]) (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 00863155A5D for ; Thu, 25 Apr 2024 21:46:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714081563; cv=none; b=ThMTaio3m2R3zYC+Fj+P7JkJ4qwUSokPhfWiQbJS1ysm5BqqTm75sVKGSIzP6WUlik9dlbfKqIFgT9hYBNt+CZX4JUcZnfzde+LZKqEszZ1NThvIQDXAidT2p1NZPaDAr5BCHifCVGzTFwGjqKiEGLB6FVSPK4SKz6NW9xpfkug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714081563; c=relaxed/simple; bh=KBAqfCc9aXWXjn3ofK+oFYsop4IYofS4yltpNOFRV+E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fZa+2rOLRHZQTEyfGu5RFpGP+5EdM3v2Q85li2s3LMVM7oLpZmk/UpgOVWLCkQLbpkclRSft4/6tbZ/FZdmKHoJgwUqRKN3+1atP6YLkrA/DtipadHGqb8T/Z/49qU5hAF16h3gGC6wopRPbhLrPhUpQzlFVb/mtCKCj1S1UptE= 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=PavWTYF/; arc=none smtp.client-ip=91.218.175.171 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:45:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714081558; 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=gojPkHBBYhfHH8Nts+6nokM2SWbYB22brKZh/DHHIWE=; b=PavWTYF/BaxN61KWH2/AES+ibnfiGZEFab/vTL8xZJh4inSYbsdS4D8BIpDB4y1NRB/TQ2 qbc6t3H9XE3U6iQpkk2BMJBapBCZhS5AKlUXHIV2FNN149deSIr+RKOR3CphAyoKnBU919 Qv4iJoYjMF7lsOdNXYtabCbRyEgx/vA= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Andrew Morton Cc: Suren Baghdasaryan , 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: References: <20240425200844.work.184-kees@kernel.org> <64cngpnwyav4odustofs6hgsh7htpc5nu23tx4lb3vxaltmqf2@sxn63f2gg4gu> <20240425143842.fe54147e4073c7d5e8b48d7b@linux-foundation.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: <20240425143842.fe54147e4073c7d5e8b48d7b@linux-foundation.org> X-Migadu-Flow: FLOW_OUT On Thu, Apr 25, 2024 at 02:38:42PM -0700, Andrew Morton wrote: > 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. That's a bit too trite; we've seen often enough that putting security above all other concerns leads to worse outcomes in the long run; impair usability too much and you're just causing more problems than you solve. We need to take a balanced approach, like with everything else we do. I'd really like to hear from Kees why pre-sorting the output so we aren't leaking kernel image details wouldn't be sufficient.