Thread (11 messages) 11 messages, 3 authors, 2021-09-28

Re: [PATCH 3/3] fs/ntfs3: Refactoring of ntfs_set_ea

From: Joe Perches <joe@perches.com>
Date: 2021-09-24 16:39:02
Also in: lkml, ntfs3

On Fri, 2021-09-24 at 19:16 +0300, Konstantin Komarov wrote:
Make code more readable.
Don't try to read zero bytes.
Add warning when size of exteneded attribute exceeds limit.
[]
quoted hunk ↗ jump to hunk
diff --git a/fs/ntfs3/xattr.c b/fs/ntfs3/xattr.c
[]
quoted hunk ↗ jump to hunk
@@ -366,21 +368,22 @@ static noinline int ntfs_set_ea(struct inode *inode, const char *name,
[]
+	ea_info.size = cpu_to_le32(size);
+
+	/*
+	 * 1. Check ea_info.size_pack for overflow.
+	 * 2. New attibute size must fit value from $AttrDef
+	 */
+	if (new_pack > 0xffff || size > sbi->ea_max_size) {
+		ntfs_inode_warn(
+			inode,
+			"The size of exteneded attributes must not exceed 64K");
trivial typo of extended.  Pedants might suggest KiB.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help