From patchwork Mon Jul 1 17:48:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13718497 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 0D944C2BD09 for ; Mon, 1 Jul 2024 17:48:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC4E26B0085; Mon, 1 Jul 2024 13:48:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B75126B008A; Mon, 1 Jul 2024 13:48:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3BF36B008C; Mon, 1 Jul 2024 13:48:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 879AB6B0085 for ; Mon, 1 Jul 2024 13:48:17 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0D6CA1A1CF9 for ; Mon, 1 Jul 2024 17:48:17 +0000 (UTC) X-FDA: 82291917834.10.F9996F1 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf03.hostedemail.com (Postfix) with ESMTP id 615B420018 for ; Mon, 1 Jul 2024 17:48:14 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pRBHaRTd; spf=pass (imf03.hostedemail.com: domain of andrii@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=andrii@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719856072; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xY0TCoFtq/6OVPlbLmxUtj3hpxfLNbBA6kdId/lKAWk=; b=l3JIb7wEw92cela5+sAi/0XlkV0kaQSVupEo8djkabFvMbnVsrF18r8TM+ab3U8WOGHwxu 7VRDOXM2et4WllC4Qzbo6gNz6YWKafL7z94ztqGmJrNGpk3PPuP/NRJGIUkjLCZKMKvXDq BqhEAaj5RF6TfZJW4zPmn44jIi0hlBk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719856072; a=rsa-sha256; cv=none; b=MJfrUS5E1vi41FUMjP4QEYfbxGo5Zd5Fit6Gi0Urm+ZZc1zVuoCPsweEU7Qpdhvv1jnZdG CvpAmo4JoSysQuVe6wClWaDxijmz3V1PvBbzp0dxFoUe8W4cuYgZ83V2H9o2PJ08Ir7Tz9 qWcjI91BW7d7lteLjHGJbJuQf+nDFiE= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pRBHaRTd; spf=pass (imf03.hostedemail.com: domain of andrii@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=andrii@kernel.org; dmarc=pass (policy=none) header.from=kernel.org Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 4A6C46173F; Mon, 1 Jul 2024 17:48:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2E24C4AF0A; Mon, 1 Jul 2024 17:48:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1719856093; bh=vClrN8Cgz91Pyp8b4riGZaG1H0hvRxtBooe+ewQkcqs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pRBHaRTdyqI4Pp5Y/yc6w73ARTYOtRfRkHODvDLacSQU8DXg5IqqKNeCjQ7n3Xa90 DjItfOERvdhm8d/MkL4MSeAMMQcDdOQxm7hm/WOXwcVfHgtqOTPyQBoI6i67kDcfcU J66uRbX6RQkj/pBFD6TczR+Wrq1n7UctUssaf4OkwPZTCkQlYw5zoELi5QhR/UV9DN cSLvU5VKtPLiY9k2sCIOpUS8SgQEujAZK5tNUPNR8+5ArPiTnggUIQK840hF9eiLdP 5lZRbPWN2Xya4e8wyFHc9vKc8P/6iB4bMQMonqZ+wLAvsvG6ZbB7ExvCwgWwPEKbIs S7qt8NJMlML9A== From: Andrii Nakryiko To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, adobriyan@gmail.com, Andrii Nakryiko , Arnd Bergmann , Stephen Rothwell Subject: [PATCH v2 2/2] fs/procfs: improve PROCMAP_QUERY's compat mode handling Date: Mon, 1 Jul 2024 10:48:05 -0700 Message-ID: <20240701174805.1897344-2-andrii@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240701174805.1897344-1-andrii@kernel.org> References: <20240701174805.1897344-1-andrii@kernel.org> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 615B420018 X-Stat-Signature: uf99y9e3wgp814p51pkbzwss18zq7pck X-HE-Tag: 1719856094-812370 X-HE-Meta: U2FsdGVkX19wmC8tT2zKcP5FbUSBEqcwU93Urcpj+zj05uf+Vj9F+HdsS/AqgHFxTDp0CU95C1kChSF5HZuA+3j57T2I9AXg32187zMVpKSimyaTtWdKvhrXy/YfxUONi+WnGR9fS8dcXSPyBezZFrNB/cS6KvySpCV2j25RulHrvjmlWG2cuER62lNnUD8TkV0uhdXd6VMHiKi/qRhyql/syjgCLDoO+3afNMFEHdmDIYrw7dYUhKcn0zArqpkhGdmQGHDeg64OucUEczvE9Pr5h7KMXnCvs7MUlE3y8WcnmPym7/6VwOSmx4c9Sp70a5dw2guhrYTy7Hv8hyNIv9XBZaLtUBw4Xvd/3lOS2o0oDMEhoO6H9DM09r/PGahUNhjitUKGwursGIU4wXF/wDfQCgHum22pAfq899rvGdoiNsiXmezWyGfqWXyHrvMbCd6ZTgI1uCC8SQFqrR8psxoQPZNLzOrePFfqmq9yMjQvYtrFDuQWPGJvvIGHE1FU53bEYe/YALWbquvUvYytdqTybGhxQWAzPPMp5O8wiTCocjYrCbKTqq+k6eY6vLi+kA5OF8Gvkk06ITYrPavHghN+4vc9d6HxBRvErtFL6lqekO7pAzK+hEY4GktvVsK9a8MD0s6o1SVaTuRzYx+Szkc+96AXDoR7A57Ebyh/nR7Ia9NcARNDFh/Y1XJIgHGl12aLzM0p/NlKOG3moBYZbDs7dKLmT8Yh1gQRnfnZnoIPKbQ75eNHZa17HrwRlpg55pCWD5Y+0IPfptTWii+9VmmX6GgpBOgVStWGK7MC9Fx+g1h27umaQ7AyN7EZVdNeYbx+dQF6aPWqp46Oq9H4Fp+DCU+uXKaBKDot4l6rnBxf7EQG7cmq6Gw0Z1vHu7RBN2kXtz7gY2Fq/jkPQTkdITXo3cQJj1oR7XE5Nj+Hyzf6GUvzbPcnrg/KGg8cX78LnbaFaz0zRA/N8eTJM0c WTDNL1nj w/Y4qIRReg3RshXuSYi470GOyuTHilUNNCE4tiAo+faDeWcO2pTYInLnI41v+AaIcvBescIj9fCvc0UmPEojxCGrNHzEDDo7Y/H0qVVA/zA8mVQB8kkylro0B57PBlwZnwYNjwdd1bRVKu9AW5Qd1kR1WrgnQl+a5tqZbvw/trUY0kL68l875L7bklol8xYVB4aST0LOm9pxJwnWlFtJSeITMs0KIliSxVGc5ame4chsCMA2jtWLvkZIgAJzCApPe/+3yXKczxP6QVMH79cYLXIq1sboB5AntEiGJ 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: List-Subscribe: List-Unsubscribe: Kernel provides compat_ptr_ioctl() wrapper to sanitize pointers for 32-bit processes on 64-bit host architectures. Given procfs_procmap_ioctl() always expects pointer argument, this is exactly what we need. This has any effect only on 32-bit processes on s390 architecture. Suggested-by: Arnd Bergmann Fixes: 3757be498749 ("fs/procfs: implement efficient VMA querying API for /proc//maps") Signed-off-by: Andrii Nakryiko --- fs/proc/task_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 3f1d0d2f78fe..b7bb4d04e962 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -637,7 +637,7 @@ const struct file_operations proc_pid_maps_operations = { .llseek = seq_lseek, .release = proc_map_release, .unlocked_ioctl = procfs_procmap_ioctl, - .compat_ioctl = procfs_procmap_ioctl, + .compat_ioctl = compat_ptr_ioctl, }; /*