diff options
Diffstat (limited to 'security/security.c')
-rw-r--r-- | security/security.c | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/security/security.c b/security/security.c index feb18c925349..b7a5a0051807 100644 --- a/security/security.c +++ b/security/security.c | |||
@@ -384,16 +384,25 @@ void security_sb_free(struct super_block *sb) | |||
384 | call_void_hook(sb_free_security, sb); | 384 | call_void_hook(sb_free_security, sb); |
385 | } | 385 | } |
386 | 386 | ||
387 | int security_sb_eat_lsm_opts(char *options, struct security_mnt_opts *opts) | 387 | void security_free_mnt_opts(void **mnt_opts) |
388 | { | 388 | { |
389 | return call_int_hook(sb_eat_lsm_opts, 0, options, opts); | 389 | if (!*mnt_opts) |
390 | return; | ||
391 | call_void_hook(sb_free_mnt_opts, *mnt_opts); | ||
392 | *mnt_opts = NULL; | ||
393 | } | ||
394 | EXPORT_SYMBOL(security_free_mnt_opts); | ||
395 | |||
396 | int security_sb_eat_lsm_opts(char *options, void **mnt_opts) | ||
397 | { | ||
398 | return call_int_hook(sb_eat_lsm_opts, 0, options, mnt_opts); | ||
390 | } | 399 | } |
391 | EXPORT_SYMBOL(security_sb_eat_lsm_opts); | 400 | EXPORT_SYMBOL(security_sb_eat_lsm_opts); |
392 | 401 | ||
393 | int security_sb_remount(struct super_block *sb, | 402 | int security_sb_remount(struct super_block *sb, |
394 | struct security_mnt_opts *opts) | 403 | void *mnt_opts) |
395 | { | 404 | { |
396 | return call_int_hook(sb_remount, 0, sb, opts); | 405 | return call_int_hook(sb_remount, 0, sb, mnt_opts); |
397 | } | 406 | } |
398 | EXPORT_SYMBOL(security_sb_remount); | 407 | EXPORT_SYMBOL(security_sb_remount); |
399 | 408 | ||
@@ -429,13 +438,13 @@ int security_sb_pivotroot(const struct path *old_path, const struct path *new_pa | |||
429 | } | 438 | } |
430 | 439 | ||
431 | int security_sb_set_mnt_opts(struct super_block *sb, | 440 | int security_sb_set_mnt_opts(struct super_block *sb, |
432 | struct security_mnt_opts *opts, | 441 | void *mnt_opts, |
433 | unsigned long kern_flags, | 442 | unsigned long kern_flags, |
434 | unsigned long *set_kern_flags) | 443 | unsigned long *set_kern_flags) |
435 | { | 444 | { |
436 | return call_int_hook(sb_set_mnt_opts, | 445 | return call_int_hook(sb_set_mnt_opts, |
437 | opts->num_mnt_opts ? -EOPNOTSUPP : 0, sb, | 446 | mnt_opts ? -EOPNOTSUPP : 0, sb, |
438 | opts, kern_flags, set_kern_flags); | 447 | mnt_opts, kern_flags, set_kern_flags); |
439 | } | 448 | } |
440 | EXPORT_SYMBOL(security_sb_set_mnt_opts); | 449 | EXPORT_SYMBOL(security_sb_set_mnt_opts); |
441 | 450 | ||
@@ -449,9 +458,9 @@ int security_sb_clone_mnt_opts(const struct super_block *oldsb, | |||
449 | } | 458 | } |
450 | EXPORT_SYMBOL(security_sb_clone_mnt_opts); | 459 | EXPORT_SYMBOL(security_sb_clone_mnt_opts); |
451 | 460 | ||
452 | int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts) | 461 | int security_sb_parse_opts_str(char *options, void **mnt_opts) |
453 | { | 462 | { |
454 | return call_int_hook(sb_parse_opts_str, 0, options, opts); | 463 | return call_int_hook(sb_parse_opts_str, 0, options, mnt_opts); |
455 | } | 464 | } |
456 | EXPORT_SYMBOL(security_sb_parse_opts_str); | 465 | EXPORT_SYMBOL(security_sb_parse_opts_str); |
457 | 466 | ||