diff options
| author | James Morris <james.morris@microsoft.com> | 2019-04-10 17:59:20 -0400 |
|---|---|---|
| committer | James Morris <james.morris@microsoft.com> | 2019-04-10 17:59:20 -0400 |
| commit | fe9fd2ef383c2f5883fcd3f7adce0de9ce2556ff (patch) | |
| tree | c364553ccf78c5356050fe6d3b5a60da9927af2c | |
| parent | ecb8e74dac1aaeea4005c9d8f21337f9423f3d8b (diff) | |
Revert "security: inode: fix a missing check for securityfs_create_file"
This reverts commit d1a0846006e4325cc951ca0b05c02ed1d0865006.
From Al Viro:
"Rather bad way to do it - generally, register_filesystem() should be
the last thing done by initialization. Any modular code that
does unregister_filesystem() on failure exit is flat-out broken;
here it's not instantly FUBAR, but it's a bloody bad example.
What's more, why not let simple_fill_super() do it? Just
static int fill_super(struct super_block *sb, void *data, int silent)
{
static const struct tree_descr files[] = {
{"lsm", &lsm_ops, 0444},
{""}
};
and to hell with that call of securityfs_create_file() and all its
failure handling..."
Signed-off-by: James Morris <james.morris@microsoft.com>
| -rw-r--r-- | security/inode.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/security/inode.c b/security/inode.c index 667f8b15027d..b7772a9b315e 100644 --- a/security/inode.c +++ b/security/inode.c | |||
| @@ -339,11 +339,6 @@ static int __init securityfs_init(void) | |||
| 339 | #ifdef CONFIG_SECURITY | 339 | #ifdef CONFIG_SECURITY |
| 340 | lsm_dentry = securityfs_create_file("lsm", 0444, NULL, NULL, | 340 | lsm_dentry = securityfs_create_file("lsm", 0444, NULL, NULL, |
| 341 | &lsm_ops); | 341 | &lsm_ops); |
| 342 | if (IS_ERR(lsm_dentry)) { | ||
| 343 | unregister_filesystem(&fs_type); | ||
| 344 | sysfs_remove_mount_point(kernel_kobj, "security"); | ||
| 345 | return PTR_ERR(lsm_dentry); | ||
| 346 | } | ||
| 347 | #endif | 342 | #endif |
| 348 | return 0; | 343 | return 0; |
| 349 | } | 344 | } |
