linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs-utils: fix truncated uid/gid fields of extended inodes
@ 2021-09-29 11:01 Gao Xiang
  0 siblings, 0 replies; only message in thread
From: Gao Xiang @ 2021-09-29 11:01 UTC (permalink / raw)
  To: linux-erofs; +Cc: Gao Xiang

Uid/gid of extended inodes was badly assigned with le16_to_cpu()
by mistake. It could cause truncated values if uid/gid >= 65536.
Fix it now.

Fixes: 6a61ce1450c5 ("erofs-utils: complete extended inode support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
---
 lib/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/inode.c b/lib/inode.c
index 1538673aa0c6..6597a26f7ac4 100644
--- a/lib/inode.c
+++ b/lib/inode.c
@@ -466,8 +466,8 @@ static bool erofs_bh_flush_write_inode(struct erofs_buffer_head *bh)
 
 		u.die.i_ino = cpu_to_le32(inode->i_ino[0]);
 
-		u.die.i_uid = cpu_to_le16(inode->i_uid);
-		u.die.i_gid = cpu_to_le16(inode->i_gid);
+		u.die.i_uid = cpu_to_le32(inode->i_uid);
+		u.die.i_gid = cpu_to_le32(inode->i_gid);
 
 		u.die.i_ctime = cpu_to_le64(inode->i_ctime);
 		u.die.i_ctime_nsec = cpu_to_le32(inode->i_ctime_nsec);
-- 
2.24.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-29 11:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-29 11:01 [PATCH] erofs-utils: fix truncated uid/gid fields of extended inodes Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).