2018-09-24 10:59:38 |
Benjamin Schuele |
bug |
|
|
added bug |
2018-09-24 11:00:06 |
Ubuntu Kernel Bot |
linux (Ubuntu): status |
New |
Incomplete |
|
2018-09-24 11:00:09 |
Ubuntu Kernel Bot |
tags |
|
xenial |
|
2018-09-24 11:00:37 |
Benjamin Schuele |
description |
come later |
Hello, just found a bug in selinux.
Whats going wrong:
Copy a link with "-a" option while selinux is on.
steps to reproduce:
~$ mkdir -p a/b
~$ ln -s b a/c
~$ cp -a a b
cp: failed to restore the default file creation context: Invalid argument
Results of my investigation:
The "cp" of coreutils is calling "setfscreatecon (NULL)" to restore the default file creation context (coreutils-8.30/src/copy.c:1771) as it is stated in the selinux api (/libselinux/include/selinux/selinux.h:71).
As we see in the result of strace below, the kernel returns an -1 on try to restore the default file creation context. So in my opinion is the bug has to be in the selinux_setprocattr method in the security/selinux/hooks.c file.
Part of "strace cp -a a b"
lgetxattr("a/c", "security.selinux", "system_u:object_r:user_home_dir_t:s0", 255) = 37
readlink("a/c", "b", 2) = 1
symlink("b", "b/a/c") = 0
open("/proc/self/task/2136/attr/fscreate", O_RDWR|O_CLOEXEC) = 3
write(3, NULL, 0) = -1 EINVAL (Invalid argument)
close(3) = 0
open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2995, ...}) = 0
read(3, "# Locale name alias data base.\n#"..., 4096) = 2995
read(3, "", 4096) = 0
close(3) |
|
2018-09-24 11:03:08 |
Benjamin Schuele |
linux (Ubuntu): status |
Incomplete |
Confirmed |
|
2018-09-26 20:52:05 |
Joseph Salisbury |
linux (Ubuntu): importance |
Undecided |
Medium |
|
2018-09-26 20:52:08 |
Joseph Salisbury |
linux (Ubuntu): status |
Confirmed |
Incomplete |
|
2018-09-26 20:52:27 |
Joseph Salisbury |
linux (Ubuntu): status |
Incomplete |
Triaged |
|
2018-09-26 20:52:49 |
Joseph Salisbury |
nominated for series |
|
Ubuntu Bionic |
|
2018-09-26 20:52:49 |
Joseph Salisbury |
bug task added |
|
linux (Ubuntu Bionic) |
|
2018-09-26 20:52:56 |
Joseph Salisbury |
linux (Ubuntu Bionic): importance |
Undecided |
Medium |
|
2018-09-26 20:52:59 |
Joseph Salisbury |
linux (Ubuntu Bionic): status |
New |
In Progress |
|
2018-09-26 20:53:04 |
Joseph Salisbury |
linux (Ubuntu): status |
Triaged |
In Progress |
|
2018-09-26 20:53:08 |
Joseph Salisbury |
linux (Ubuntu Bionic): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2018-09-26 20:53:11 |
Joseph Salisbury |
linux (Ubuntu): assignee |
|
Joseph Salisbury (jsalisbury) |
|
2018-10-11 22:22:58 |
Anthony McConnell-Collins |
bug |
|
|
added subscriber Anthony McConnell-Collins |
2019-01-23 01:04:12 |
Joseph Salisbury |
linux (Ubuntu Bionic): status |
In Progress |
Confirmed |
|
2019-01-23 01:04:14 |
Joseph Salisbury |
linux (Ubuntu): status |
In Progress |
Confirmed |
|
2019-01-23 01:04:17 |
Joseph Salisbury |
linux (Ubuntu): assignee |
Joseph Salisbury (jsalisbury) |
|
|
2019-01-23 01:04:19 |
Joseph Salisbury |
linux (Ubuntu Bionic): assignee |
Joseph Salisbury (jsalisbury) |
|
|
2019-04-22 21:13:12 |
Terry Rudd |
bug |
|
|
added subscriber Terry Rudd |
2020-06-11 16:22:01 |
Kai Kasurinen |
bug |
|
|
added subscriber Kai Kasurinen |