From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D05F6C54EE9 for ; Thu, 8 Sep 2022 21:59:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 25BD08D0003; Thu, 8 Sep 2022 17:59:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 20C8D8D0001; Thu, 8 Sep 2022 17:59:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0D3BA8D0003; Thu, 8 Sep 2022 17:59:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EE8BC8D0001 for ; Thu, 8 Sep 2022 17:59:37 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C73711602CB for ; Thu, 8 Sep 2022 21:59:37 +0000 (UTC) X-FDA: 79890285594.18.2F1B594 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf12.hostedemail.com (Postfix) with ESMTP id 5EE554008C for ; Thu, 8 Sep 2022 21:59:37 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9A57A61E43; Thu, 8 Sep 2022 21:59:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36330C433C1; Thu, 8 Sep 2022 21:59:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1662674375; bh=/HOVvpz+sJygGAhZ94LvkuF6jNiDecR818x1rR3XGzU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ziAXRAK+Fi/bF9GMSVOP8poDDRgu67p7SOqUL7S9oGMHlwKx0zxVlVdB8UA+WisKa kVFuoKWv+MAHa7Gro/kRQvgnbUEANZgF1WejcJK3cn6vMbF6n3LfYsYdia18BEgeWe Yo6hZcES7ugfEegxDzx414/7Ac7vOq9LtXH0mVvY= Date: Thu, 8 Sep 2022 14:59:34 -0700 From: Andrew Morton To: Vincent Whitchurch Cc: , , , , , , Subject: Re: [PATCH] proc: Enable smaps_rollup without ptrace rights Message-Id: <20220908145934.4565620db7cbc3b9ceb90e3b@linux-foundation.org> In-Reply-To: <20220908093919.843346-1-vincent.whitchurch@axis.com> References: <20220908093919.843346-1-vincent.whitchurch@axis.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662674377; a=rsa-sha256; cv=none; b=QIyM2kzIfgebcixzFQsoRC0puubzbgInQVJpB8BKM4b8QPnSg8OWfvwyhr6JOtTCodihP9 CGDcNH/pnSVWHWT0hOnFZtIxoQq3FKY2/JY3ttCeU2xI6+F1jr5/TZVG5pJuuWQGcyVxAJ VvsiSIlQyyMrGA/+FxJ1EiE7V561pzo= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ziAXRAK+; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662674377; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SnExRcRVsjk4CJ9cftZjLct4CxMi+Q9nKYH9xxSYRdY=; b=T29ligTeptVoJOaLcDDOYCTBcxhY3nbhHZR7rnPuNjjlvI9g+l1iCMX1gRc3lF6o3jHPU8 h1/k1A3mJIafT4z68e2gGiSw2pGMjF85Gv2Q+up48v380WclGaGHrwUNp9mE9CPjau04IH GVQl8OEz605jb8ZAAdYTQZm9MX4yndw= X-Stat-Signature: bdcyjp7ntb7z3njs1ydkcig55iq67nfk X-Rspam-User: X-Rspamd-Queue-Id: 5EE554008C X-Rspamd-Server: rspam07 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=ziAXRAK+; spf=pass (imf12.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1662674377-77571 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 8 Sep 2022 11:39:19 +0200 Vincent Whitchurch wrote: > smaps_rollup is currently only allowed on processes which the user has > ptrace permissions for, since it uses a common proc open function used > by other files like mem and smaps. > > However, while smaps provides detailed, individual information about > each memory map in the process (justifying its ptrace rights > requirement), smaps_rollup only provides a summary of the memory usage, > which is not unlike the information available from other places like the > status and statm files, which do not need ptrace permissions. > > The first line of smaps_rollup could however be sensitive, since it > exposes the randomized start and end of the process' address space. > This information however does not seem essential to smap_rollup's > purpose and could be replaced with placeholder values to preserve the > format without leaking information. (I could not find any user space in > Debian or Android which uses the information in the first line.) > > Replace the start with 0 and end with ~0 and allow smaps_rollup to be > opened and read regardless of ptrace permissions. What is the motivation for this? Use case? End-user value and such?