public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.1] fs/ntfs3: Fix general protection fault in run_is_mapped_full
@ 2024-11-14  9:31 Bin Lan
  2024-11-15  5:19 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Bin Lan @ 2024-11-14  9:31 UTC (permalink / raw)
  To: gregkh, stable

From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

[ Upstream commit a33fb016e49e37aafab18dc3c8314d6399cb4727 ]

Fixed deleating of a non-resident attribute in ntfs_create_inode()
rollback.

Reported-by: syzbot+9af29acd8f27fbce94bc@syzkaller.appspotmail.com
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
---
 fs/ntfs3/inode.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
index 026ed43c0670..8d1cfa0fc13f 100644
--- a/fs/ntfs3/inode.c
+++ b/fs/ntfs3/inode.c
@@ -1646,6 +1646,15 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns,
 			  le16_to_cpu(new_de->key_size), sbi);
 	/* ni_unlock(dir_ni); will be called later. */
 out6:
+	attr = ni_find_attr(ni, NULL, NULL, ATTR_EA, NULL, 0, NULL, NULL);
+	if (attr && attr->non_res) {
+		/* Delete ATTR_EA, if non-resident. */
+		struct runs_tree run;
+		run_init(&run);
+		attr_set_size(ni, ATTR_EA, NULL, 0, &run, 0, NULL, false, NULL);
+		run_close(&run);
+	}
+	
 	if (rp_inserted)
 		ntfs_remove_reparse(sbi, IO_REPARSE_TAG_SYMLINK, &new_de->ref);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 6.1] fs/ntfs3: Fix general protection fault in run_is_mapped_full
  2024-11-14  9:31 [PATCH 6.1] fs/ntfs3: Fix general protection fault in run_is_mapped_full Bin Lan
@ 2024-11-15  5:19 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2024-11-15  5:19 UTC (permalink / raw)
  To: Bin Lan; +Cc: stable

On Thu, Nov 14, 2024 at 05:31:07PM +0800, Bin Lan wrote:
> From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
> 
> [ Upstream commit a33fb016e49e37aafab18dc3c8314d6399cb4727 ]
> 
> Fixed deleating of a non-resident attribute in ntfs_create_inode()
> rollback.
> 
> Reported-by: syzbot+9af29acd8f27fbce94bc@syzkaller.appspotmail.com
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
> Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
> ---
>  fs/ntfs3/inode.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c
> index 026ed43c0670..8d1cfa0fc13f 100644
> --- a/fs/ntfs3/inode.c
> +++ b/fs/ntfs3/inode.c
> @@ -1646,6 +1646,15 @@ struct inode *ntfs_create_inode(struct user_namespace *mnt_userns,
>  			  le16_to_cpu(new_de->key_size), sbi);
>  	/* ni_unlock(dir_ni); will be called later. */
>  out6:
> +	attr = ni_find_attr(ni, NULL, NULL, ATTR_EA, NULL, 0, NULL, NULL);
> +	if (attr && attr->non_res) {
> +		/* Delete ATTR_EA, if non-resident. */
> +		struct runs_tree run;
> +		run_init(&run);
> +		attr_set_size(ni, ATTR_EA, NULL, 0, &run, 0, NULL, false, NULL);
> +		run_close(&run);
> +	}
> +	

You have trailing whitespace here :(


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-11-15  5:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14  9:31 [PATCH 6.1] fs/ntfs3: Fix general protection fault in run_is_mapped_full Bin Lan
2024-11-15  5:19 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox