git: c069ca085bd1 - main - ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 28 Jul 2025 20:57:20 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=c069ca085bd185eda4a90dc4bc2b76cceb74579d
commit c069ca085bd185eda4a90dc4bc2b76cceb74579d
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-07-27 13:47:22 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-07-28 20:57:14 +0000
ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename()
Otherwise it is sign-extended into 64bit ino_t on the call to
ufs_dirrewrite(). This causes invalid inode number recorded in the SU
tracking structures (newdirem) and triggers corresponding panics.
Reviewed by: mckusick, olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D51573
---
sys/ufs/ufs/ufs_vnops.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 17308706c3f4..406b8f943077 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1268,7 +1268,8 @@ ufs_rename(
struct inode *fip, *tip, *tdp, *fdp;
struct direct newdir;
off_t endoff;
- int doingdirectory, newparent;
+ int doingdirectory;
+ u_int newparent;
int error = 0;
struct mount *mp;
ino_t ino;