diff options
author | Ondrej Mosnacek <omosnace@redhat.com> | 2019-06-12 11:12:26 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2019-06-12 23:04:05 +0300 |
commit | 464c258aa45b09f16aa0f05847ed8895873262d9 (patch) | |
tree | c00d9804a2c75ee26316361269ddeaa85be9229a /fs/signalfd.c | |
parent | beee56f3543ae688f7b3f65a5e234b59856eff48 (diff) | |
download | linux-464c258aa45b09f16aa0f05847ed8895873262d9.tar.xz |
selinux: fix empty write to keycreate file
When sid == 0 (we are resetting keycreate_sid to the default value), we
should skip the KEY__CREATE check.
Before this patch, doing a zero-sized write to /proc/self/keycreate
would check if the current task can create unlabeled keys (which would
usually fail with -EACCESS and generate an AVC). Now it skips the check
and correctly sets the task's keycreate_sid to 0.
Bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1719067
Tested using the reproducer from the report above.
Fixes: 4eb582cf1fbd ("[PATCH] keys: add a way to store the appropriate context for newly-created keys")
Reported-by: Kir Kolyshkin <kir@sacred.ru>
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'fs/signalfd.c')
0 files changed, 0 insertions, 0 deletions