]> git.ipfire.org Git - thirdparty/lxc.git/commit
Patching an incoming CVE (CVE-2022-47952) 4245/head
authorMaher Azzouzi <maherazz04@gmail.com>
Sun, 25 Dec 2022 12:50:25 +0000 (13:50 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 6 Jan 2023 14:47:43 +0000 (08:47 -0600)
commit1b0469530d7a38b8f8990e114b52530d1bf7f3b8
treef3900651260e49ee756abdc9f1314e302eca3de9
parent440727ea38ff8c8364d6caca9c5a213fc62c8499
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 <maherazz04@gmail.com>
Acked-by: Serge Hallyn <serge@hallyn.com>
src/lxc/cmd/lxc_user_nic.c