From patchwork Mon Jul 29 17:40:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrii Nakryiko X-Patchwork-Id: 13745505 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 F2E1AC3DA61 for ; Mon, 29 Jul 2024 17:40:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8486F6B0089; Mon, 29 Jul 2024 13:40:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F84E6B009A; Mon, 29 Jul 2024 13:40:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6714B6B009B; Mon, 29 Jul 2024 13:40:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4928C6B0089 for ; Mon, 29 Jul 2024 13:40:50 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id E2B6D4055D for ; Mon, 29 Jul 2024 17:40:49 +0000 (UTC) X-FDA: 82393505418.20.610DCD0 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id 5BE2140004 for ; Mon, 29 Jul 2024 17:40:48 +0000 (UTC) Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=abSG6dIR; spf=pass (imf01.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722274821; a=rsa-sha256; cv=none; b=1797kC7GIBlq8xJ01FmsHpO07khE1ubfKwjOKlxjFhq4zedIhZayf9N32EfC74e7NoSqnS +CZDwBnp+hdB1Awg0xXUvwSVVatyykBv1oObiM8ybFpseZ8lMyFHtBN3Hw62hLWkTQMMgu aOuVYDBmYE0lj3/2/qoMaoSlooDfezc= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=abSG6dIR; spf=pass (imf01.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=1722274821; 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:references:dkim-signature; bh=AudogPiUJHr7SpI0rZF4kub31xGqNru9+nxfcfvqLpI=; b=NTlEugWIKWIAvKgCZDQpowFiBBAzR5QLkztyDA/CmU2D/4m4sTbgMAAVxpvtjagfSRwcaf 4WZ/cjLiMbgCIiZ21KJTj4/xxRBQcVad8Vkb6JdIKdoJYsFiUyQiwmenac+B8kytuglKqr GFL4OGy/vpZtA1EkeRMg+ZgiRWVbWBg= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 69AD561BE6; Mon, 29 Jul 2024 17:40:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FE79C32786; Mon, 29 Jul 2024 17:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722274847; bh=LWW1/BZkWBLP3Tf/ZADHPaHtHdDn/4RW9VkLUmLTGQI=; h=From:To:Cc:Subject:Date:From; b=abSG6dIRfLLXaJlWR4pdlEmEjg47ajPpuocowilM116XziMOGJqNCyZXPoYWR7FKI P6vhhuq6NgfBo8ZW9z9O3DZrMOvLNB3xGiaIqpX3q96AmAB+EEW2mr/Ksetd2HIjHr AHe55rLvFBNjqHrViakaHFZRfIz8uJgaSzq7z6UYEt3wQUY8EmFi7mBE0L3dDTBcCE Iu5VK8CjP1xDrLvVNou7yRYASLJpQCIIobLnG4aWuunEq1pYanvL45m4dx7sYt3CWb IY4WhAr/6yNUYdx/Df3r9MgdskXo+v1lAVVC9dGsbNSnKKvE9uKIWN2dbCuGmOvMNv UN0FXu2ihgksA== 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 , Jann Horn Subject: [PATCH] fs/procfs: remove build ID-related code duplication in PROCMAP_QUERY Date: Mon, 29 Jul 2024 10:40:44 -0700 Message-ID: <20240729174044.4008399-1-andrii@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Stat-Signature: yp1bnkrmd4ksnd5kqcfsqey434h8nbpf X-Rspamd-Queue-Id: 5BE2140004 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1722274848-988356 X-HE-Meta: U2FsdGVkX19Tv50iT/z2pkoWVecooaUM88Z0K/MUpJjGFV0Hb/ww3wGyt5PR+nRtinZjv6gKpSq1ftOkvRMpsCmvaYaj8pE15DYQZEG0OkaKtDHegEDGtdt2kpD5wX4q3i5pstn+vLpf2CyRYIj0mohR0Kp2DsvYT6IMjYrbjBbcJmGU7HAYLCZpPwrZSqqDKCJJ5M0d1IGtRbVxYMOlRnDA5OdCVnQ79rDRjIHalSpLghHSpjhoOlut/BSiPrDl+sW0p9fv2T2M26ZymLosbGmK6E0JayXOusH+GyNpkPfAm2CvBnFFY+zgdvhFZ2gU6IbIPERWgpn13N5YXwpOypR4sXpOrIz6Bpkvx6LFob7j04ZmW8SU/a2xyuz7bb+bc5JVbfFFyD4r3ZYI97lIqV3gzwVh2tpDFlLSdl2S+MVnYkykx3RrQxDJksVDQndPauRWuI906rQ/P8O3NII4YWFIrBn0D1N/G4KIQTxVOVu6fO67wxBvArg2tHzKBUlIR8JOjBQ3Tuzl3WsQJ8d+xn5Ymyso1nFO7JdRNyWkvphWTkFqPxcM30Jo9pIFORndqZKn4R5hA3nTTvWI4gKyXxLqFh/NZ/rPKXOqnicEtmKm4Vxj+VupAqh4UJ9NW6vHRrzpgQgef/6jBH7fzmq38I1i9MMkvbnFG7puD1hK8k3nVDBFUivCp1auin6qH1rjtRaPdtcQfCJGcfKLtzMn5JXRTVRQ2deD445pVCMuS+cE0v63YTci1TRsA0CwiCawE9z0BIwQUourPrYquJPtGgSDAY7PHHSRO+HTyA3eDcewgwylqPmTSzwhJADwRAHygU60kxFz64UU+sZXJNv6WkklsdUCky5Hj8M0xGRQkUt6wylEh6y/FWUCBMoHL/tRn1IXfMAy4K9Z1w3/IuIRBHdRfFM21I7kBH+IAAraMCW6JwZh0ji29oQIPe7stNUkVP8PuGaYSKXzWzDCAf/ unuNcoN5 nJU60CXay2yxBmxbmgf/d+NzuxGS4EK+VrYiinhimwti3MXGNhVGYwMAR+6IrokGIrgU8hmPn7kQjJH1Z83GOdmQsEtBEVPNghDBARchBOH2CaKIHkK1SlE+fYQ8RVFV283XyUOk6+NRFi68+6IZFm/VNV+SyMKHEjV6vxNWJwCe4lusLLVG/qKRHCv454447/Q7bRNMmjbBBfjEXcIEEihM8XQ+GvGIYmTqa9tPD88GrTtkr0BYjXG1vMNIkf7RkzTJ4cwzdbLVdcH+LJRFZXBoq8/8BqHAsjmUzUKxxyjmejr8KkjzqIN8jZw== 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: A piece of build ID handling code in PROCMAP_QUERY ioctl() was accidentally duplicated. It wasn't meant to be part of ed5d583a88a9 ("fs/procfs: implement efficient VMA querying API for /proc//maps") commit, which is what introduced duplication. It has no correctness implications, but we unnecessarily perform the same work twice, if build ID parsing is requested. Drop the duplication. Reported-by: Jann Horn Fixes: ed5d583a88a9 ("fs/procfs: implement efficient VMA querying API for /proc//maps") Signed-off-by: Andrii Nakryiko --- fs/proc/task_mmu.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 5f171ad7b436..3ba613052506 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -543,21 +543,6 @@ static int do_procmap_query(struct proc_maps_private *priv, void __user *uarg) } } - if (karg.build_id_size) { - __u32 build_id_sz; - - err = build_id_parse(vma, build_id_buf, &build_id_sz); - if (err) { - karg.build_id_size = 0; - } else { - if (karg.build_id_size < build_id_sz) { - err = -ENAMETOOLONG; - goto out; - } - karg.build_id_size = build_id_sz; - } - } - if (karg.vma_name_size) { size_t name_buf_sz = min_t(size_t, PATH_MAX, karg.vma_name_size); const struct path *path;