History

vfs: Add LSM hooks for the new mount API

Add LSM hooks for use by the new mount API and filesystem context code. This includes: (1) Hooks to handle allocation, duplication and freeing of the security record attached to a filesystem context. (2) A hook to snoop source specifications. There may be multiple of these if the filesystem supports it. They will to be local files/devices if fs_context::source_is_dev is true and will be something else, possibly remote server specifications, if false. (3) A hook to snoop superblock configuration options in key[=val] form. If the LSM decides it wants to handle it, it can suppress the option being passed to the filesystem. Note that 'val' may include commas and binary data with the fsopen patch. (4) A hook to perform validation and allocation after the configuration has been done but before the superblock is allocated and set up. (5) A hook to transfer the security from the context to a newly created superblock. (6) A hook to rule on whether a path point can be used as a mountpoint. These are intended to replace: security_sb_copy_data security_sb_kern_mount security_sb_mount security_sb_set_mnt_opts security_sb_clone_mnt_opts security_sb_parse_opts_str [AV -- some of the methods being replaced are already gone, some of the methods are not added for the lack of need]

David Howells committed 8 years ago

Commit da2441f1 parent 31d921c3 files · +29 −0Browse files

Showing the changes to security (1 of 3 files). Show all

Unified · Split

security/security.c+5−0
@@ -374,6 +374,11 @@ void security_bprm_committed_creds(struct linux_binprm *bprm) · 373 unmodified lines
374 call_void_hook(bprm_committed_creds, bprm);374 call_void_hook(bprm_committed_creds, bprm);
375}375}
376 376
377int security_fs_context_parse_param(struct fs_context *fc, struct fs_parameter *param)
378{
379 return call_int_hook(fs_context_parse_param, -ENOPARAM, fc, param);
380}
381
377int security_sb_alloc(struct super_block *sb)382int security_sb_alloc(struct super_block *sb)
378{383{
379 return call_int_hook(sb_alloc_security, 0, sb);384 return call_int_hook(sb_alloc_security, 0, sb);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t