[lxc/lxc] a14c8c: Patching an incoming CVE (CVE-2022-47952)

1 view
Skip to first unread message

Christian Brauner

unread,
Apr 20, 2023, 11:15:26 AM4/20/23
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/stable-4.0
Home: https://github.com/lxc/lxc
Commit: a14c8c1fab2b3f3e8dcc5e7f2c2c216b6da7ad5d
https://github.com/lxc/lxc/commit/a14c8c1fab2b3f3e8dcc5e7f2c2c216b6da7ad5d
Author: Maher Azzouzi <maher...@gmail.com>
Date: 2023-04-20 (Thu, 20 Apr 2023)

Changed paths:
M src/lxc/cmd/lxc_user_nic.c

Log Message:
-----------
Patching an incoming CVE (CVE-2022-47952)

lxc-user-nic in lxc through 5.0.1 is installed setuid root, and may
allow local users to infer whether any file exists, even within a
protected directory tree, because "Failed to open" often indicates
that a file does not exist, whereas "does not refer to a network
namespace path" often indicates that a file exists. NOTE: this is
different from CVE-2018-6556 because the CVE-2018-6556 fix design was
based on the premise that "we will report back to the user that the
open() failed but the user has no way of knowing why it failed";
however, in many realistic cases, there are no plausible reasons for
failing except that the file does not exist.

PoC:
> % ls /l
> ls: cannot open directory '/l': Permission denied
> % /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic delete lol lol /l/h/tt h h
> cmd/lxc_user_nic.c: 1096: main: Failed to open "/l/h/tt" <----- file does not exist.
> % /usr/lib/x86_64-linux-gnu/lxc/lxc-user-nic delete lol lol /l/h/t h h
> cmd/lxc_user_nic.c: 1101: main: Path "/l/h/t" does not refer to a network namespace path <---- file exist!

Signed-off-by: MaherAzzouzi <maher...@gmail.com>
Acked-by: Serge Hallyn <se...@hallyn.com>
(cherry picked from commit 1b0469530d7a38b8f8990e114b52530d1bf7f3b8)
Signed-off-by: Ranjitsinh Rathod <ranjitsinh...@gmail.com>


Commit: 6c44acbd0f34d1912ecafb0dfe6a053e6d6da90e
https://github.com/lxc/lxc/commit/6c44acbd0f34d1912ecafb0dfe6a053e6d6da90e
Author: Christian Brauner <chri...@brauner.io>
Date: 2023-04-20 (Thu, 20 Apr 2023)

Changed paths:
M src/lxc/cmd/lxc_user_nic.c

Log Message:
-----------
Merge pull request #4303 from ranjitsinhrathod1991/fix-CVE-2022-47952

Patching an incoming CVE (CVE-2022-47952)


Compare: https://github.com/lxc/lxc/compare/7fc2f34daecd...6c44acbd0f34
Reply all
Reply to author
Forward
0 new messages