diff options
Diffstat (limited to 'security/security.c')
| -rw-r--r-- | security/security.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/security/security.c b/security/security.c index 0e1f1f124368..b6c57a6b2ff5 100644 --- a/security/security.c +++ b/security/security.c | |||
| @@ -288,11 +288,6 @@ void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *d | |||
| 288 | security_ops->sb_post_remount(mnt, flags, data); | 288 | security_ops->sb_post_remount(mnt, flags, data); |
| 289 | } | 289 | } |
| 290 | 290 | ||
| 291 | void security_sb_post_mountroot(void) | ||
| 292 | { | ||
| 293 | security_ops->sb_post_mountroot(); | ||
| 294 | } | ||
| 295 | |||
| 296 | void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd) | 291 | void security_sb_post_addmount(struct vfsmount *mnt, struct nameidata *mountpoint_nd) |
| 297 | { | 292 | { |
| 298 | security_ops->sb_post_addmount(mnt, mountpoint_nd); | 293 | security_ops->sb_post_addmount(mnt, mountpoint_nd); |
| @@ -308,6 +303,26 @@ void security_sb_post_pivotroot(struct nameidata *old_nd, struct nameidata *new_ | |||
| 308 | security_ops->sb_post_pivotroot(old_nd, new_nd); | 303 | security_ops->sb_post_pivotroot(old_nd, new_nd); |
| 309 | } | 304 | } |
| 310 | 305 | ||
| 306 | int security_sb_get_mnt_opts(const struct super_block *sb, | ||
| 307 | char ***mount_options, | ||
| 308 | int **flags, int *num_opts) | ||
| 309 | { | ||
| 310 | return security_ops->sb_get_mnt_opts(sb, mount_options, flags, num_opts); | ||
| 311 | } | ||
| 312 | |||
| 313 | int security_sb_set_mnt_opts(struct super_block *sb, | ||
| 314 | char **mount_options, | ||
| 315 | int *flags, int num_opts) | ||
| 316 | { | ||
| 317 | return security_ops->sb_set_mnt_opts(sb, mount_options, flags, num_opts); | ||
| 318 | } | ||
| 319 | |||
| 320 | void security_sb_clone_mnt_opts(const struct super_block *oldsb, | ||
| 321 | struct super_block *newsb) | ||
| 322 | { | ||
| 323 | security_ops->sb_clone_mnt_opts(oldsb, newsb); | ||
| 324 | } | ||
| 325 | |||
| 311 | int security_inode_alloc(struct inode *inode) | 326 | int security_inode_alloc(struct inode *inode) |
| 312 | { | 327 | { |
| 313 | inode->i_security = NULL; | 328 | inode->i_security = NULL; |
| @@ -478,11 +493,11 @@ int security_inode_killpriv(struct dentry *dentry) | |||
| 478 | return security_ops->inode_killpriv(dentry); | 493 | return security_ops->inode_killpriv(dentry); |
| 479 | } | 494 | } |
| 480 | 495 | ||
| 481 | int security_inode_getsecurity(const struct inode *inode, const char *name, void *buffer, size_t size, int err) | 496 | int security_inode_getsecurity(const struct inode *inode, const char *name, void **buffer, bool alloc) |
| 482 | { | 497 | { |
| 483 | if (unlikely(IS_PRIVATE(inode))) | 498 | if (unlikely(IS_PRIVATE(inode))) |
| 484 | return 0; | 499 | return 0; |
| 485 | return security_ops->inode_getsecurity(inode, name, buffer, size, err); | 500 | return security_ops->inode_getsecurity(inode, name, buffer, alloc); |
| 486 | } | 501 | } |
| 487 | 502 | ||
| 488 | int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) | 503 | int security_inode_setsecurity(struct inode *inode, const char *name, const void *value, size_t size, int flags) |
| @@ -816,6 +831,12 @@ int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | |||
| 816 | } | 831 | } |
| 817 | EXPORT_SYMBOL(security_secid_to_secctx); | 832 | EXPORT_SYMBOL(security_secid_to_secctx); |
| 818 | 833 | ||
| 834 | int security_secctx_to_secid(char *secdata, u32 seclen, u32 *secid) | ||
| 835 | { | ||
| 836 | return security_ops->secctx_to_secid(secdata, seclen, secid); | ||
| 837 | } | ||
| 838 | EXPORT_SYMBOL(security_secctx_to_secid); | ||
| 839 | |||
| 819 | void security_release_secctx(char *secdata, u32 seclen) | 840 | void security_release_secctx(char *secdata, u32 seclen) |
| 820 | { | 841 | { |
| 821 | return security_ops->release_secctx(secdata, seclen); | 842 | return security_ops->release_secctx(secdata, seclen); |
