Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 2025 20:57:20 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c069ca085bd1 - main - ufs_vnops.c: use unsigned type for newparent inode number in ufs_rename()
Message-ID:  <202507282057.56SKvKt2019363@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202507282057.56SKvKt2019363>