Unverified Commit 623051c7 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!7803 v2 selinux: avoid dereference of garbage after mount failure

parents 70df70b4 bdb2cef7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2232,13 +2232,17 @@ static int __init init_sel_fs(void)
		pr_err("selinuxfs:  could not mount!\n");
		err = PTR_ERR(selinuxfs_mount);
		selinuxfs_mount = NULL;
		selinux_null.mnt = NULL;
		return err;
	}

	selinux_null.dentry = d_hash_and_lookup(selinux_null.mnt->mnt_root,
						&null_name);
	if (IS_ERR(selinux_null.dentry)) {
		pr_err("selinuxfs:  could not lookup null!\n");
		err = PTR_ERR(selinux_null.dentry);
		selinux_null.dentry = NULL;
		return err;
	}

	return err;