]> git.baikalelectronics.ru Git - kernel.git/commit
capabilities: Don't allow writing ambiguous v3 file capabilities
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 17 Dec 2020 15:42:00 +0000 (09:42 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 29 Dec 2020 15:32:35 +0000 (09:32 -0600)
commit3c29cbff9ca5366dbbe28461c1f3b8298cf77610
tree2fc2d2322c5c44e0baa3726a3070caed8886a0a8
parent703b4aaeda226c411ae7e592fdcf61efe00c01a0
capabilities: Don't allow writing ambiguous v3 file capabilities

The v3 file capabilities have a uid field that records the filesystem
uid of the root user of the user namespace the file capabilities are
valid in.

When someone is silly enough to have the same underlying uid as the
root uid of multiple nested containers a v3 filesystem capability can
be ambiguous.

In the spirit of don't do that then, forbid writing a v3 filesystem
capability if it is ambiguous.

Fixes: f142a909d302 ("Introduce v3 namespaced file capabilities")
Reviewed-by: Andrew G. Morgan <morgan@kernel.org>
Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
security/commoncap.c