diff options
author | Roberto Sassu <roberto.sassu@huawei.com> | 2020-06-03 17:08:20 +0200 |
---|---|---|
committer | Mimi Zohar <zohar@linux.ibm.com> | 2020-06-03 14:54:35 -0400 |
commit | 067a436b1b0aafa593344fddd711a755a58afb3b (patch) | |
tree | c4b00bc233e0ab411a834adab49b0941b1d76729 /sound/isa/opti9xx | |
parent | 8eb613c0b8f19627ba1846dcf78bb2c85edbe8dd (diff) | |
download | linux-067a436b1b0aafa593344fddd711a755a58afb3b.tar.bz2 |
ima: Directly assign the ima_default_policy pointer to ima_rules
This patch prevents the following oops:
[ 10.771813] BUG: kernel NULL pointer dereference, address: 0000000000000
[...]
[ 10.779790] RIP: 0010:ima_match_policy+0xf7/0xb80
[...]
[ 10.798576] Call Trace:
[ 10.798993] ? ima_lsm_policy_change+0x2b0/0x2b0
[ 10.799753] ? inode_init_owner+0x1a0/0x1a0
[ 10.800484] ? _raw_spin_lock+0x7a/0xd0
[ 10.801592] ima_must_appraise.part.0+0xb6/0xf0
[ 10.802313] ? ima_fix_xattr.isra.0+0xd0/0xd0
[ 10.803167] ima_must_appraise+0x4f/0x70
[ 10.804004] ima_post_path_mknod+0x2e/0x80
[ 10.804800] do_mknodat+0x396/0x3c0
It occurs when there is a failure during IMA initialization, and
ima_init_policy() is not called. IMA hooks still call ima_match_policy()
but ima_rules is NULL. This patch prevents the crash by directly assigning
the ima_default_policy pointer to ima_rules when ima_rules is defined. This
wouldn't alter the existing behavior, as ima_rules is always set at the end
of ima_init_policy().
Cc: stable@vger.kernel.org # 3.7.x
Fixes: 07f6a79415d7d ("ima: add appraise action keywords and default rules")
Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Diffstat (limited to 'sound/isa/opti9xx')
0 files changed, 0 insertions, 0 deletions