From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795889204; b=JQqfkIpOfRXO2XYtDeRYlbGGQNbO87dPfQyLVVwSTCEAGs1BeX0FpLtitQFCX0F49erG 0yXg3Y4bYiF3OHlcpt0alV+Gqx2NWCb4PJiTPHX46wk9UK8hOZL5fVkh6YKPvaGzOMCmM ubnIvU3C3NaC0YQfkW01FOWOC+fvbCFGprdfTSIEXTl5C6QqY6PmffscG4wBfQJw5SCdM k3Qksnb+qhBUV0udnuvpzwa8cjJPXbItaSWG/lQzuBnKoXlBzq5W6Y15mTFEHQ5RXTt2R 7QaYEaXQqmL5GOGSXTHSxd/tSqsMLUEQCLbNoH2ULiiCRQyamJE1FEvhuWOC4gy7BJQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795889204; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=9ypCRyQA025EFQOlwv+7zYkkWRbtinASSaaJ/Vx00zw=; b=eiINC5mpaF9G1uhmtLfMH8ZXS4/YVrIkxX1AjJGHDlILCW+SCSBzszde3Zsd9g9As1Eh YUgsCRX91KZg3R/iAQxiU/wRZT55KVb1Y776MCGfNpEbOXcYptKStn9ew0SP0QFrMQebY LZGgtPs209I0u8RJHR24LG7Yr0EOTwyQlbzjwaLxfdVnY3AC2qe52XG3KanOuRIR25i0/ cu3gQvuY+Pmr3kGABjuXM/vPpD4Y0GMT5R8OhOrHzp/aoJQcmniqvdu0A/s4IgIo/mK7V 1fYxwa2BTdIU0+yCoFO0CgOhEgKVLx3WdPlMAZuvQeEdoEn1kbdWW1NiF+WD2t9hS2A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fQLh7Qwa; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46B8C606A31C for ; Sat, 28 Nov 2026 18:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=fQLh7Qwa Received: by smtp.kernel.org (Postfix) with ESMTPSA id 17D4F1F000C1 for ; Sat, 28 Nov 2026 18:06:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795889204; bh=9ypCRyQA025EFQOlwv+7zYkkWRbtinASSaaJ/Vx00zw=; h=From:Subject:Reply-To:Cc:In-Reply-To:References:Date; b=fQLh7QwaD51PwOlqHos7eC3BxleLdxu1Buk4zaj85U2wt9JQ2xd5ojYue2Pbsa8nb azVklQ82hmeOXV4LLwEA6xAkZ+C+eRKPk3Kr4ytPPT6TtBU+5hnsqm0jewj9hIBQ+F DyXbANLNLTn92t5ngdidVR1H3SHKWYa5gM/L2nKkc/2K02N77ldUIvWcnZn3+6X8t2 wnivtk+jn5aR9UsgduxmfKLj5ydupq8rpJVicHotXiNcZucvwUT8zWRdEXHdwFNxbH ZnmEc6SqhmdW6bwwmHLKPZOWDKgwRso6q5oJV/wZrIrp1Ir3QCKQoT2SqOhWTH28Xg Xye17hmzqDHaQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] tomoyo: Drop FOLL_FORCE from tomoyo_dump_page() Reply-To: sashiko-reviews@lists.linux.dev Cc: linux-security-module@vger.kernel.org In-Reply-To: <3c1a731469fb589685dd2168f7c8def736d806cf.1795863061.git.chris@chrisdown.name> References: <3c1a731469fb589685dd2168f7c8def736d806cf.1795863061.git.chris@chrisdown.name> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 18:06:43 +0000 X-Mailing-List: linux-security-module@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > tomoyo_dump_page() reads the argv and envp pages of the nascent exec mm > with get_user_pages_remote(..., FOLL_FORCE, ...). Its own comment says it > does the same thing as get_arg_page(bprm, pos, 0) in fs/exec.c, but > get_arg_page() stopped passing FOLL_FORCE in > commit cd57e443831d ("exec: Remove FOLL_FORCE for stack setup"), so the > two have drifted apart. >=20 > FOLL_FORCE only matters here if the page sits in a VMA that is not > readable. That can't happen: tomoyo_dump_page() is called from the > bprm_check_security hook, which runs before the binfmt handler calls > setup_arg_pages(), and at that point the only VMA in bprm->mm is the > stack VMA created by create_init_stack_vma() with VMA_STACK_FLAGS. Those > are built from the architecture's VMA_STACK_DEFAULT_FLAGS, which falls > back to VMA_DATA_DEFAULT_FLAGS. Every definition of either in the tree > is built from VMA_DATA_FLAGS_EXEC, VMA_DATA_FLAGS_TSK_EXEC or > VMA_DATA_FLAGS_NON_EXEC, and all three include VMA_READ_BIT and > VMA_MAYREAD_BIT. Reading without FOLL_FORCE therefore works for every > page tomoyo_dump_page() can be asked for. >=20 > FOLL_FORCE is being removed from callers that are not really ptrace so > that it can eventually be renamed to FOLL_PTRACE. Let's drop it here > too, which also brings the code back in line with its comment. >=20 > No functional change is intended. >=20 > Signed-off-by: Chris Down Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/3c1a731469fb589685d= d2168f7c8def736d806cf.1795863061.git.chris@chrisdown.name?part=3D1