Pull fsnotify updates from Jan Kara: "Support for auditing decisions regarding fanotify permission events" * tag 'fsnotify_for_v6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: fanotify,audit: Allow audit to use the full permission event response fanotify: define struct members to hold response decision context fanotify: Ensure consistent variable type for response
Showing the changes to include/uapi (1 of 7 files). Show all
Unified · Split
| @@ -188,15 +188,43 @@ struct fanotify_event_info_error { · 187 unmodified lines | |||
| 188 | __u32 error_count; | 188 | __u32 error_count; |
| 189 | }; | 189 | }; |
| 190 | 190 | ||
| 191 | /* | ||
| 192 | * User space may need to record additional information about its decision. | ||
| 193 | * The extra information type records what kind of information is included. | ||
| 194 | * The default is none. We also define an extra information buffer whose | ||
| 195 | * size is determined by the extra information type. | ||
| 196 | * | ||
| 197 | * If the information type is Audit Rule, then the information following | ||
| 198 | * is the rule number that triggered the user space decision that | ||
| 199 | * requires auditing. | ||
| 200 | */ | ||
| 201 | |||
| 202 | #define FAN_RESPONSE_INFO_NONE 0 | ||
| 203 | #define FAN_RESPONSE_INFO_AUDIT_RULE 1 | ||
| 204 | |||
| 191 | struct fanotify_response { | 205 | struct fanotify_response { |
| 192 | __s32 fd; | 206 | __s32 fd; |
| 193 | __u32 response; | 207 | __u32 response; |
| 194 | }; | 208 | }; |
| 195 | 209 | ||
| 210 | struct fanotify_response_info_header { | ||
| 211 | __u8 type; | ||
| 212 | __u8 pad; | ||
| 213 | __u16 len; | ||
| 214 | }; | ||
| 215 | |||
| 216 | struct fanotify_response_info_audit_rule { | ||
| 217 | struct fanotify_response_info_header hdr; | ||
| 218 | __u32 rule_number; | ||
| 219 | __u32 subj_trust; | ||
| 220 | __u32 obj_trust; | ||
| 221 | }; | ||
| 222 | |||
| 196 | /* Legit userspace responses to a _PERM event */ | 223 | /* Legit userspace responses to a _PERM event */ |
| 197 | #define FAN_ALLOW 0x01 | 224 | #define FAN_ALLOW 0x01 |
| 198 | #define FAN_DENY 0x02 | 225 | #define FAN_DENY 0x02 |
| 199 | #define FAN_AUDIT 0x10 /* Bit mask to create audit record for result */ | 226 | #define FAN_AUDIT 0x10 /* Bitmask to create audit record for result */ |
| 227 | #define FAN_INFO 0x20 /* Bitmask to indicate additional information */ | ||
| 200 | 228 | ||
| 201 | /* No fd set in event */ | 229 | /* No fd set in event */ |
| 202 | #define FAN_NOFD -1 | 230 | #define FAN_NOFD -1 |