syscalls/fanotify03: add FAN_OPEN_EXEC_PERM tcase support
PATCH 3/5 syscalls/fanotify03: add FAN_OPEN_EXEC_PERM tcase support
* Defined FAN_OPEN_EXEC_PERM flag in local tests header file to accommodate for the fact if it's not defined in system user space headers
* Defined new tcase's for each mark type to support new fanotify flag FAN_OPEN_EXEC_PERM tests
* Updated fanotify_mark failure logic to report the instance where FAN_OPEN_EXEC_PERM flag is not available within the kernel
Signed-off-by Matthew Bobrowski <[email protected]>
Reviewed-by Amir Goldstein <[email protected]>
--- testcases/kernel/syscalls/fanotify/fanotify.h | 13 +++++ testcases/kernel/syscalls/fanotify/fanotify03.c | 63 +++++++++++++++++++++---- 2 files changed, 66 insertions(+), 10 deletions(-)
testcases/kernel/syscalls/fanotify/fanotify.h +13 -0
@@ -64,6 +64,19 @@ static long fanotify_mark(int fd, unsigned int flags, uint64_t mask,#ifndef FAN_MARK_FILESYSTEM #define FAN_MARK_FILESYSTEM 0x00000100#endif +#ifndef FAN_OPEN_EXEC_PERM +#define FAN_OPEN_EXEC_PERM 0x00040000 +#endif + +/* +* FAN_ALL_PERM_EVENTS has been deprecated, so any new permission events +* are not to be added to it. To cover the instance where a new permission +* event is defined, we create a new macro that is to include all +* permission events. Any new permission events should be added to this +* macro. +*/ +#define LTP_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_OPEN_EXEC_PERM | \ + FAN_ACCESS_PERM)struct fanotify_mark_type {unsigned int flag;
testcases/kernel/syscalls/fanotify/fanotify03.c +53 -10
125 lines not on this page · raw message
Signature · 5 lines
2.16.4 -- Matthew Bobrowski