From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2FA7927A476 for ; Fri, 1 May 2026 12:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777638007; cv=none; b=LQvc00VC8V1L26MF30dTvyGsafDqR57Bz1XH8HvSaccRxEn8fNKGCVJN77hY5FYcjFojHX05cnMXGCNGmb+iEylMoyzBJRUUrg/hcJd561ABfuTVZh0Yl/VJ3k3Y8aGYCeBqX4B9gY7Uz1mZORACdaKzAE8YRd38BmmUQjwV/h0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777638007; c=relaxed/simple; bh=uRfiToCv8J0AS+m8iphWeHVZKm0rMSZTOfWhOG5nUiY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=pvwnW1XKLTzShmoIZ1r0gvJ6AKj1ciq5tjk2L6y3gU5KN9/n9a2O47B6++h3uakAnowSPYbnlzVB6KIPF5FyBLUfy8WaVM2LgO1/x4Ygt+I3QtrDWtRLetZeYCxHM7MY3RPF11z/qc2mjGEfMaIBriV+TnXb2GjLS93+pm7FDzg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ag+UecKx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ag+UecKx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75318C2BCB4; Fri, 1 May 2026 12:20:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777638006; bh=uRfiToCv8J0AS+m8iphWeHVZKm0rMSZTOfWhOG5nUiY=; h=Subject:To:Cc:From:Date:From; b=ag+UecKxyhkwB+YEQPCQ2iah5QWAqu3hLMiSezE5fAUaoy4CDVMLPlDMcsQYfsUkV JfSUe9Ztb0mK8IUFSAHYLqzE1HjwmTQzya1VmI6W+cJBJVZcdBnXqVMyw7bp4NxraC nN38zzW5hKGDZcwEskLcfwQVpODVGo8lV9tWKrL4= Subject: FAILED: patch "[PATCH] fs: prepare for adding LSM blob to backing_file" failed to apply to 6.12-stable tree To: amir73il@gmail.com,paul@paul-moore.com,serge@hallyn.com Cc: From: Date: Fri, 01 May 2026 14:20:04 +0200 Message-ID: <2026050104-spotter-moody-9d29@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.12-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.12.y git checkout FETCH_HEAD git cherry-pick -x 880bd496ec72a6dcb00cb70c430ef752ba242ae7 # git commit -s git send-email --to '' --in-reply-to '2026050104-spotter-moody-9d29@gregkh' --subject-prefix 'PATCH 6.12.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 880bd496ec72a6dcb00cb70c430ef752ba242ae7 Mon Sep 17 00:00:00 2001 From: Amir Goldstein Date: Mon, 30 Mar 2026 10:27:51 +0200 Subject: [PATCH] fs: prepare for adding LSM blob to backing_file In preparation to adding LSM blob to backing_file struct, factor out helpers init_backing_file() and backing_file_free(). Cc: stable@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-unionfs@vger.kernel.org Cc: linux-erofs@lists.ozlabs.org Signed-off-by: Amir Goldstein Reviewed-by: Serge Hallyn [PM: use the term "LSM blob", fix comment style to match file] Signed-off-by: Paul Moore diff --git a/fs/file_table.c b/fs/file_table.c index aaa5faaace1e..3b3792903185 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -66,6 +66,12 @@ void backing_file_set_user_path(struct file *f, const struct path *path) } EXPORT_SYMBOL_GPL(backing_file_set_user_path); +static inline void backing_file_free(struct backing_file *ff) +{ + path_put(&ff->user_path); + kmem_cache_free(bfilp_cachep, ff); +} + static inline void file_free(struct file *f) { security_file_free(f); @@ -73,8 +79,7 @@ static inline void file_free(struct file *f) percpu_counter_dec(&nr_files); put_cred(f->f_cred); if (unlikely(f->f_mode & FMODE_BACKING)) { - path_put(backing_file_user_path(f)); - kmem_cache_free(bfilp_cachep, backing_file(f)); + backing_file_free(backing_file(f)); } else { kmem_cache_free(filp_cachep, f); } @@ -283,6 +288,12 @@ struct file *alloc_empty_file_noaccount(int flags, const struct cred *cred) return f; } +static int init_backing_file(struct backing_file *ff) +{ + memset(&ff->user_path, 0, sizeof(ff->user_path)); + return 0; +} + /* * Variant of alloc_empty_file() that allocates a backing_file container * and doesn't check and modify nr_files. @@ -305,7 +316,14 @@ struct file *alloc_empty_backing_file(int flags, const struct cred *cred) return ERR_PTR(error); } + /* The f_mode flags must be set before fput(). */ ff->file.f_mode |= FMODE_BACKING | FMODE_NOACCOUNT; + error = init_backing_file(ff); + if (unlikely(error)) { + fput(&ff->file); + return ERR_PTR(error); + } + return &ff->file; } EXPORT_SYMBOL_GPL(alloc_empty_backing_file);