Message ID | 20250124191946.22308-8-cel@kernel.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 C76FCC02181 for <linux-mm@archiver.kernel.org>; Fri, 24 Jan 2025 19:20:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8382F280092; Fri, 24 Jan 2025 14:20:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E702280065; Fri, 24 Jan 2025 14:20:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 688DE280092; Fri, 24 Jan 2025 14:20:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 3C9A2280065 for <linux-mm@kvack.org>; Fri, 24 Jan 2025 14:20:02 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EDC9B1C8FDD for <linux-mm@kvack.org>; Fri, 24 Jan 2025 19:20:01 +0000 (UTC) X-FDA: 83043310602.05.86EF474 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf04.hostedemail.com (Postfix) with ESMTP id 56FA34000B for <linux-mm@kvack.org>; Fri, 24 Jan 2025 19:20:00 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BUQULhBP; spf=pass (imf04.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737746400; 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=V9QQpk3QN8dO41maw5Dm8uhOKmRJsyT1Ghm9Hi512Bo=; b=kbwu4fGNEVPTQZfNoDCdeTv/HR+/khfP2A+RR13azpHMITHvrxNcvidmv0SYpSm+cppSlj 9nFA9wPiipT5FrLfrYa9bA59UcVeWvtx8HfEe0NjCSIkOC1B1bkuJzU5lnA3yBdK/FFKlL /NjC9k5qplz25PhH1/ijxkTI+gWOIyw= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=BUQULhBP; spf=pass (imf04.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737746400; a=rsa-sha256; cv=none; b=no5tf8tlGVhJ/87F79dhs++X4AgN1IPnLaimI5Sj+3o4Oyk+pGh55NWWP9piWLIbWHOLpF er6cjdfuxWXKNlMd+SBKaiqRJbmkRdjJ6Ot6X+aqicdOjvfnM6wIpm97EFsTlA8ju5SEE4 zqgiQDSqyoX9ZamudoECVQMCbRVc+5U= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 68C335C6192; Fri, 24 Jan 2025 19:19:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 423B6C4CEE0; Fri, 24 Jan 2025 19:19:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737746399; bh=+MlNwIFBadfJD8EMoOx2TqTDKMIrB7l68m+npdFSw20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BUQULhBPqFOT/WhqvnY3sV0lAtBbbNP/wiyOPU3EEo9WSLCOAzMoLbGTftvUmLQ2Z olyO1ZMSyx1YOFhYOC2eOXp8d4oFAVYf78UT4oPTKwI/6olDxREnW2Xb2BNyMngNS1 8O13HK60trrGWcOzqhAv8yz5htOozX5ENWUczZaN1d8xzR55sFG0CBUFzI5gV+Vl6S 0rY/vX/heKu7yIJcmj9kWXV30qy7N1/tNV5cz4bRRp0MxxNWVxETCnW/R55Ob7TJsS 2Fij7yqZtieFohKbzUMBN6EpvjRpg75WykhEzrNDMUYir8bWF++XqIZIiacoikLoEO 8e8Xq3gMXpJoA== From: cel@kernel.org To: Hugh Dickins <hughd@google.com>, Andrew Morten <akpm@linux-foundation.org>, Christian Brauner <brauner@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org> Cc: <linux-fsdevel@vger.kernel.org>, <stable@vger.kernel.org>, <linux-mm@kvack.org>, yukuai3@huawei.com, yangerkun@huawei.com, Chuck Lever <chuck.lever@oracle.com>, Jeff Layton <jlayton@kernel.org> Subject: [RFC PATCH v6.6 07/10] libfs: Return ENOSPC when the directory offset range is exhausted Date: Fri, 24 Jan 2025 14:19:42 -0500 Message-ID: <20250124191946.22308-8-cel@kernel.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20250124191946.22308-1-cel@kernel.org> References: <20250124191946.22308-1-cel@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 56FA34000B X-Stat-Signature: zyprird3p3nn4tif7bq9ea1ck3x49zex X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1737746400-331203 X-HE-Meta: U2FsdGVkX182t1ru2Aj0TXMp29T13yjA/zunvw2ovKPkXZyaIBmH6iIbSj+JJw+QxbrGNtbYLwJSFhVRT6G5KdI8l6jOL7dGJvaiYFhdPBd9k0sd+5aZEVThyVtVj4HS3briMx2RyvqaEjB5UhA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p5SwRy2TCxAWOvfs96cF6QU/huFTA== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Address CVE-2024-46701
|
expand
|
diff --git a/fs/libfs.c b/fs/libfs.c index ab9fc182fd22..200bcfc2ac34 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -287,8 +287,8 @@ int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry) ret = xa_alloc_cyclic(&octx->xa, &offset, dentry, limit, &octx->next_offset, GFP_KERNEL); - if (ret < 0) - return ret; + if (unlikely(ret < 0)) + return ret == -EBUSY ? -ENOSPC : ret; offset_set(dentry, offset); return 0;