Bug 1223080 (CVE-2024-26821)

Summary: VUL-0: REJECTED: CVE-2024-26821: kernel: fs: relax mount_setattr() permission checks
Product: [Novell Products] SUSE Security Incidents Reporter: SMASH SMASH <smash_bz>
Component: IncidentsAssignee: Security Team bot <security-team>
Status: RESOLVED INVALID QA Contact: Security Team bot <security-team>
Severity: Normal    
Priority: P3 - Medium CC: ailiopoulos, jack, mhocko, osalvador, rgoldwyn, thomas.leroy
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
URL: https://smash.suse.de/issue/402309/
Whiteboard:
Found By: Security Response Team Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description SMASH SMASH 2024-04-18 12:56:15 UTC
In the Linux kernel, the following vulnerability has been resolved:

fs: relax mount_setattr() permission checks

When we added mount_setattr() I added additional checks compared to the
legacy do_reconfigure_mnt() and do_change_type() helpers used by regular
mount(2). If that mount had a parent then verify that the caller and the
mount namespace the mount is attached to match and if not make sure that
it's an anonymous mount.

The real rootfs falls into neither category. It is neither an anoymous
mount because it is obviously attached to the initial mount namespace
but it also obviously doesn't have a parent mount. So that means legacy
mount(2) allows changing mount properties on the real rootfs but
mount_setattr(2) blocks this. I never thought much about this but of
course someone on this planet of earth changes properties on the real
rootfs as can be seen in [1].

Since util-linux finally switched to the new mount api in 2.39 not so
long ago it also relies on mount_setattr() and that surfaced this issue
when Fedora 39 finally switched to it. Fix this.

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2024-26821
https://www.cve.org/CVERecord?id=CVE-2024-26821
https://git.kernel.org/stable/c/2a7a31e1fb9717845d9d5e2a8c6e48848147801e
https://git.kernel.org/stable/c/31f71f2d7a081fc6c6bdf06865beedf6db5b0ca4
https://git.kernel.org/stable/c/46f5ab762d048dad224436978315cbc2fa79c630
https://git.kernel.org/stable/c/95de4ad173ca0e61034f3145d66917970961c210
https://git.kernel.org/pub/scm/linux/security/vulns.git/plain/cve/published/2024/CVE-2024-26821.mbox
https://bugzilla.redhat.com/show_bug.cgi?id=2275616
Comment 1 Thomas Leroy 2024-04-18 12:57:03 UTC
I'm not sure of the security implication of this one. It seems that it can only crash a booting kernel
Comment 4 Jan Kara 2024-04-19 09:00:00 UTC
Yes, this problem is of the type: New API (i.e. mount_setattr(2)) doesn't support what the old API did support (i.e. mount(2)). Thus the new API is not a complete replacement of the old API and someone actually cared so let's fix that.

I agree that there's no security implication at all.
Comment 7 Anthony Iliopoulos 2024-05-16 12:29:50 UTC
It is now rejected [1], assigning back to sec.

[1] https://lore.kernel.org/all/2024051606-imaging-entrench-b327@gregkh/
Comment 8 Thomas Leroy 2024-05-28 08:43:13 UTC
Thanks everyone for the help. Closing