From patchwork Wed Dec 4 15:52:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13893976 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 BBC3AE7716B for ; Wed, 4 Dec 2024 15:53:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 221EE6B007B; Wed, 4 Dec 2024 10:53:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AB316B0083; Wed, 4 Dec 2024 10:53:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 04D056B0085; Wed, 4 Dec 2024 10:53:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id D2CA86B007B for ; Wed, 4 Dec 2024 10:53:05 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 4C2E11A1116 for ; Wed, 4 Dec 2024 15:53:05 +0000 (UTC) X-FDA: 82857719952.15.305AE40 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf28.hostedemail.com (Postfix) with ESMTP id 0C95EC001D for ; Wed, 4 Dec 2024 15:52:45 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DYwsUeQK; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of cel@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=cel@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1733327570; a=rsa-sha256; cv=none; b=IqOzey7MUQf7nxEyN84AbB7KvHEDBOVNsgXDvRn7GDi3qd4CFAouFLDgnJSohd8lnh/wdj IL0d1BqB3lGLVm/KQqqyln5AHMMsYdv7hPvxGQ5v2/Ip/5Ru0DMXnKXhncjWjov9M2G9Wc rWZ80LbxWviV4DO8JSjxtj8FZDxsJxU= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=DYwsUeQK; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of cel@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=cel@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1733327570; 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=BwBURTv60HhiBRg5qmcoMP95C4HC0lBN9GgwNUlhteE=; b=6ZTCmERx2dOynpFi3K1LV/IhNzf96r2Xi3OTLX5cB3HZVctXV+NtlcEOJpFdVYP0PtQGUc wa1MUPwhMxTCQXCijWd9HYd9fgl9TOkKj2bjFzOHiWbIF+u8C/CQvFfA0R1gnrHJpQtIx5 TWDBOmsiGsyEAodGwAaJutK9IUY/WGY= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A3021A41951; Wed, 4 Dec 2024 15:51:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B28C0C4CECD; Wed, 4 Dec 2024 15:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1733327582; bh=ZU7Nssg8iB+meP4HAiNWJezwZvfDo+ne6ZypdoYaqwg=; h=From:To:Cc:Subject:Date:From; b=DYwsUeQKxcLpZgO0celx1C91UYQa0hbIMraV873fjVYDcaBJ3JsHbJY73O1NjAYIm IUxCmqsP36TjLZHRPbgWcdrH6P+/SgrnzzmqRaD8ikbhHlvMHnOn4M7C9lqAexDdDf 9gUl01TeHOdyBgyADPbuC7Lb8iS+N9PNwpO8m96lAHLQvTJCGOiJhCXu6rBHXzI00p 15NKAS/+/PYdiaL163BFqueuwouNLMlDXVtVGDhq9I24dkYtE1AuUYas4dP792DWWy 98fH9cObdpy51zG7VPK78Rgzgfo5yh7NFQd55wM17o977cHP107ckeVVSWHLLWEQqb TS28UD4x2guqg== From: cel@kernel.org To: Hugh Dickens , Christian Brauner , Al Viro Cc: , , yukuai3@huawei.com, yangerkun@huaweicloud.com, Chuck Lever Subject: [PATCH v4 0/5] Improve simple directory offset wrap behavior Date: Wed, 4 Dec 2024 10:52:51 -0500 Message-ID: <20241204155257.1110338-1-cel@kernel.org> X-Mailer: git-send-email 2.47.0 MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0C95EC001D X-Stat-Signature: so37it9ndp3sdcddety6exorybyh589i X-Rspam-User: X-HE-Tag: 1733327565-529526 X-HE-Meta: U2FsdGVkX18L28YkrSyz/nehXfg1Y1ut/ONZ3qRrdsGloBU1wE3lLwCsoTmQbOBPWWPOuCO1WCOMgvK4i49QbWuv4UAbqB9nmc/OVvVjRKtNyjkFHgqsqiOdSn12XtykA3X0K2Z+NnQoxWnaePQLR4MSLDv0hl+yhdJIQOSqKF86pZVQFzMgLUAa7Tj2OzhZGVYJOk25RAMiU4WaBR0SXxijfxH1aoPceWqzy+weqxPHF6xpzdarH6t3FJ5midUtOO08RADdAve5OZKJh3aFGsKPpcY2rwMQznpfArl7nncHK1bQDkOND1IwRBpztFmf7gAf11lH1cvr1Ga63U+yHDrFQCE1dk5MjKzGmYar7ZhscNjCHtQmOfVCFRwtevmS4HCcn1EN7iRZGRuEs1nET2ec/DgYxQOOWU8bJYv7g8/nMIxN1G0j789HXbKqLJaomb0LP0g2NQhuvjPXRvtKfazkKq0rf+RCwppiVslB9wd+a/x1yElud9zS4W7v9LYiyhCAuTwCB2ayA2jps04P8Dk0mlMReR8zwrkQRjogxFmbLMB7PYulMT0bv2jUXQ4Bac6CPwWVOeCgZzOKcl9hjt1JH6PYE5fykhPtAX3rQFL07HcgEX0nVGBbLomyDpENj4BSuyCRR9BsTDCWKJ906dw4IUYnPLoSoVhTPRh59EpwAqpSq+DpQim1LeEfxBzZCRIrNrvmN0FOZA0JN5NzB1m5PFpVCexUByinJ3GQZbAb8dWt9u587F0vYKyYT6yE+ZdhiM6DQhggrK83o85Vk2pE1ycqOgmyR3XO8GNuYvur48fQll6FZzV4SS1s/UCXGhHphbQlG4mGB7g+tlGZSMNGTKwnuipuERxAhLDiYgh+8DGDhD7Bh6hv3OJLbLfzjhMMQgeMiYkKVmrrsYeX73+IhuuiRiUkg1m2pi/wDlwD9ROvdEgvlXb+3kkYzq8cC6/CNg+RUPPHG00OmKx 3d0pApCp 7MmyIxU1KEU89YrzyaO/Wao3s2xyCTm1Fl7vZaz+PkbMdt1JdIzme5GnqaN+a+O5ZaWPuaROQq6pu8bclLC3CfA7AfotAtzWqquXdFox81NPDp4wrXoZRYGHaQ1+1ZJ1EnYjMUsb8xtu4VBli45F48w4jzBP6eMbD9X2KOIpU0glfjXzqIY4Hxqn9m/2ilukGDpwTDtEPpY04kAH1koq9X9tjnN7jzdsLDB2lNzKo3iecRpqykAOJB9mlgGY6RaFcweyw 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: From: Chuck Lever The purpose of this series is to construct a set of upstream fixes that can be backported to v6.6 to address CVE-2024-46701. My original plan was to add a cursor dentry. However, I've found a solution that does not need one. In fact, most or all of the reported issues are gone with 4/5. Thus I'm not sure 5/5 is necessary, but it seems like a robust improvement. Changes since v3: - Series is no longer RFC - Series passes xfstests locally and via NFS export - Patch 2/5 was replaced; it now removes simple_offset_empty() - 4/5 and 5/5 were rewritten based on test results - Patch descriptions have been clarified This series (still against v6.12) has been pushed to: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/log/?h=tmpfs-fixes Next step is to try backporting these to v6.6 to see if anything else is needed. Chuck Lever (5): libfs: Return ENOSPC when the directory offset range is exhausted Revert "libfs: Add simple_offset_empty()" Revert "libfs: fix infinite directory reads for offset dir" libfs: Replace simple_offset end-of-directory detection libfs: Use d_children list to iterate simple_offset directories fs/libfs.c | 158 ++++++++++++++++++++++----------------------- include/linux/fs.h | 1 - mm/shmem.c | 4 +- 3 files changed, 81 insertions(+), 82 deletions(-)