From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43F713CB2C7 for ; Thu, 2 Jul 2026 13:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782997939; cv=none; b=OeB46X9MCmsPDCjtWdjnGcUmW1ZCermNhJj3xCtQHRZOtsU/SFRdh8QEQPqUVUuTnh/FTjA+kVquEEKRqnOOuDN7cywHA1A2VYneDwrYR4DIxCrKyuQwmHaQzT60zYhCHhnrhyJFz8d+om/Dyj/c+br1LFrpXWpoJu0gVLYvj3A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782997939; c=relaxed/simple; bh=Hsgt+pJG7bK81saFC91SPtse5KbwlAZ1MNfRSir7rxM=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=qWRzoNVypLhFsDW0sI5m385yTvYfWkGOfLP8DdWBRXbUSWjXbCCcapVN4/v+xQ6Uft3RYUxSLM7uWbpTf+/bKe9Luy2F7/SbCE5StwNjnNWDyxEl29e3Gn3EPLn5TWfn3TA1Fsu8/yQKEwgWZ75IpCKJIaUjzy4Zcwxv5xs54UA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XgUY17zo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="XgUY17zo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B02671F000E9; Thu, 2 Jul 2026 13:12:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1782997938; bh=sq6JEuReYAhlZszbKLaiND/84O/ah5qQdeUqjxtnbZk=; h=Subject:To:Cc:From:Date; b=XgUY17zo5joTJcoKMomOySbT85CBHVlQhTXrIchjzyRF8Ca2mjNsqOjmIYlg1saOL hIAzo+UwFBBOX+KpomPtdpWDgeRc8f+9vQ42D96bOZySlgIY5gmte3jasBugqSoQ4h lUH2Py10dvv+ZkxVfwaWg7oahkpgmcr0W+j5ndRA= Subject: FAILED: patch "[PATCH] f2fs: fix listxattr handling of corrupted xattr entries" failed to apply to 6.6-stable tree To: iganschel@gmail.com,chao@kernel.org,jaegeuk@kernel.org Cc: From: Date: Thu, 02 Jul 2026 15:12:01 +0200 Message-ID: <2026070201-sixties-drearily-6c6d@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y git checkout FETCH_HEAD git cherry-pick -x 5ef5bc304f23c3fe255d4936472378dcb74d0e94 # git commit -s git send-email --to '' --in-reply-to '2026070201-sixties-drearily-6c6d@gregkh' --subject-prefix 'PATCH 6.6.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5ef5bc304f23c3fe255d4936472378dcb74d0e94 Mon Sep 17 00:00:00 2001 From: Keshav Verma Date: Mon, 22 Jun 2026 20:44:21 +0530 Subject: [PATCH] f2fs: fix listxattr handling of corrupted xattr entries Validate the xattr entry before reading its fields in f2fs_listxattr(). Return -EFSCORRUPTED when the entry is outside the valid xattr storage area instead of returning a successful partial result. Fixes: 688078e7f36c ("f2fs: fix to avoid memory leakage in f2fs_listxattr") Cc: stable@kernel.org Reviewed-by: Chao Yu Signed-off-by: Keshav Verma Signed-off-by: Jaegeuk Kim diff --git a/fs/f2fs/xattr.c b/fs/f2fs/xattr.c index 24cef7e1f56a..ed33e5110f2a 100644 --- a/fs/f2fs/xattr.c +++ b/fs/f2fs/xattr.c @@ -583,8 +583,6 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) size_t prefix_len; size_t size; - prefix = f2fs_xattr_prefix(entry->e_name_index, dentry); - if ((void *)(entry) + sizeof(__u32) > last_base_addr || (void *)XATTR_NEXT_ENTRY(entry) > last_base_addr) { f2fs_err(F2FS_I_SB(inode), "list inode (%llu) has corrupted xattr", @@ -594,9 +592,11 @@ ssize_t f2fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size) ERROR_CORRUPTED_XATTR); fserror_report_file_metadata(inode, -EFSCORRUPTED, GFP_NOFS); - break; + error = -EFSCORRUPTED; + goto cleanup; } + prefix = f2fs_xattr_prefix(entry->e_name_index, dentry); if (!prefix) continue;