security: Create file_truncate hook from path_truncate hook
authorGünther Noack <gnoack3000@gmail.com>
Tue, 18 Oct 2022 18:22:06 +0000 (20:22 +0200)
committerMickaël Salaün <mic@digikod.net>
Wed, 19 Oct 2022 07:01:40 +0000 (09:01 +0200)
commit3350607dc5637be2563f484dcfe2fed456f3d4ff
treefda8bd79084e26e2062fec46370c1a572b0d187f
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
security: Create file_truncate hook from path_truncate hook

Like path_truncate, the file_truncate hook also restricts file
truncation, but is called in the cases where truncation is attempted
on an already-opened file.

This is required in a subsequent commit to handle ftruncate()
operations differently to truncate() operations.

Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20221018182216.301684-2-gnoack3000@gmail.com
Signed-off-by: Mickaël Salaün <mic@digikod.net>
fs/namei.c
fs/open.c
include/linux/lsm_hook_defs.h
include/linux/lsm_hooks.h
include/linux/security.h
security/apparmor/lsm.c
security/security.c
security/tomoyo/tomoyo.c