lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20230713-shrimps-urlaub-80a9818b50d9@brauner>
Date:   Thu, 13 Jul 2023 17:21:29 +0200
From:   Christian Brauner <brauner@...nel.org>
To:     Aleksa Sarai <cyphar@...har.com>
Cc:     Christian Brauner <brauner@...nel.org>,
        Thomas Weissschuh <thomas@...ch.de>, stable@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Dave Chinner <dchinner@...hat.com>,
        xu xin <cgel.zte@...il.com>, Al Viro <viro@...iv.linux.org.uk>,
        "Liam R. Howlett" <Liam.Howlett@...cle.com>,
        Zhihao Cheng <chengzhihao1@...wei.com>,
        Stefan Roesch <shr@...kernel.io>,
        Janis Danisevskis <jdanis@...gle.com>,
        Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v2] procfs: block chmod on /proc/thread-self/comm

On Fri, 14 Jul 2023 00:09:58 +1000, Aleksa Sarai wrote:
> Due to an oversight in commit 1b3044e39a89 ("procfs: fix pthread
> cross-thread naming if !PR_DUMPABLE") in switching from REG to NOD,
> chmod operations on /proc/thread-self/comm were no longer blocked as
> they are on almost all other procfs files.
> 
> A very similar situation with /proc/self/environ was used to as a root
> exploit a long time ago, but procfs has SB_I_NOEXEC so this is simply a
> correctness issue.
> 
> [...]

Just to reiterate: The long term fix to avoid these odd behavioral bugs
in the future is to remove the fallback to simple_setattr() we still
have in notify_change() that happens when no setattr inode operation has
been explicitly defined. To do this we need to change all filesystem
that rely on this fallback to explicitly set simple_setattr() as their
inode operation. Then notify_change() would simply return EOPNOTSUPP
when no setattr iop is defined making such omissions pretty obvious.

But that's a bigger patch. This is a backportable fix for this issue.
Needs long soaking in -next ofc.

---

Applied to the fs.proc.uapi branch of the vfs/vfs.git tree.
Patches in the fs.proc.uapi branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: fs.proc.uapi

[1/1] procfs: block chmod on /proc/thread-self/comm
      https://git.kernel.org/vfs/vfs/c/ccf61486fe1e

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ