Patch "sysctl: always initialize i_uid/i_gid" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sysctl: always initialize i_uid/i_gid

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sysctl-always-initialize-i_uid-i_gid.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b4c197c0c5ff48298e9bfd35df42ba749b9a0ef8
Author: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Date:   Tue Apr 2 23:10:34 2024 +0200

    sysctl: always initialize i_uid/i_gid
    
    [ Upstream commit 98ca62ba9e2be5863c7d069f84f7166b45a5b2f4 ]
    
    Always initialize i_uid/i_gid inside the sysfs core so set_ownership()
    can safely skip setting them.
    
    Commit 5ec27ec735ba ("fs/proc/proc_sysctl.c: fix the default values of
    i_uid/i_gid on /proc/sys inodes.") added defaults for i_uid/i_gid when
    set_ownership() was not implemented. It also missed adjusting
    net_ctl_set_ownership() to use the same default values in case the
    computation of a better value failed.
    
    Fixes: 5ec27ec735ba ("fs/proc/proc_sysctl.c: fix the default values of i_uid/i_gid on /proc/sys inodes.")
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
    Signed-off-by: Joel Granados <j.granados@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index c468cc0f6d69b..df77a7bcce498 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -483,12 +483,10 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
 			make_empty_dir_inode(inode);
 	}
 
+	inode->i_uid = GLOBAL_ROOT_UID;
+	inode->i_gid = GLOBAL_ROOT_GID;
 	if (root->set_ownership)
 		root->set_ownership(head, &inode->i_uid, &inode->i_gid);
-	else {
-		inode->i_uid = GLOBAL_ROOT_UID;
-		inode->i_gid = GLOBAL_ROOT_GID;
-	}
 
 	return inode;
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux