git: e3e0f6e7a517 - stable/15 - linux: cap mount id to INT_MAX

From: ShengYi Hung <aokblast_at_FreeBSD.org>
Date: Sun, 01 Nov 2026 22:08:42 UTC
The branch stable/15 has been updated by aokblast:

URL: https://cgit.FreeBSD.org/src/commit/?id=e3e0f6e7a517f828679830e34ff91a3600975115

commit e3e0f6e7a517f828679830e34ff91a3600975115
Author:     ShengYi Hung <aokblast@FreeBSD.org>
AuthorDate: 2026-08-26 20:44:47 +0000
Commit:     ShengYi Hung <aokblast@FreeBSD.org>
CommitDate: 2026-11-01 22:08:22 +0000

    linux: cap mount id to INT_MAX
    
    linux stores mount id as a int32_t, using xor would make it becomes
    negative in some cases. As a result, we cap the value to INT_MAX to
    prevent getting a negative value from userspace.
    
    MFC after:      2 weeks
    Differential Revision: https://reviews.freebsd.org/D59202
    
    (cherry picked from commit 23626eb9e3d61928358c9c813aa5a17e797ba404)
---
 sys/compat/linprocfs/linprocfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 9d0ceaa6245e..1b00c2f8f736 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -621,7 +621,8 @@ linprocfs_doprocmountinfo(PFS_FILL_ARGS)
 		 * (5) mountto path
 		 */
 		sbuf_printf(sb, "%u 0 0:0 / %s ",
-		    sp->f_fsid.val[0] ^ sp->f_fsid.val[1], mntto);
+		    (sp->f_fsid.val[0] ^ sp->f_fsid.val[1]) & 0x7fffffff,
+		    mntto);
 		/* (6) mount options */
 		_sbuf_mntoptions_helper(sb, sp->f_flags);
 		/*