linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mimi Zohar <zohar@linux.ibm.com>
To: Roberto Sassu <roberto.sassu@huawei.com>, tiwai@suse.de
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	linux-kernel@vger.kernel.org, silviu.vlasceanu@huawei.com,
	stable@vger.kernel.org
Subject: Re: [PATCH 1/2] ima: Directly assign the ima_default_policy pointer to ima_rules
Date: Wed, 03 Jun 2020 17:30:22 -0400	[thread overview]
Message-ID: <1591219822.5146.2.camel@linux.ibm.com> (raw)
In-Reply-To: <20200603150821.8607-1-roberto.sassu@huawei.com>

On Wed, 2020-06-03 at 17:08 +0200, Roberto Sassu wrote:
> 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>

Thanks, Roberto!

      parent reply	other threads:[~2020-06-03 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-03 15:08 [PATCH 1/2] ima: Directly assign the ima_default_policy pointer to ima_rules Roberto Sassu
2020-06-03 15:08 ` [PATCH 2/2] ima: Call ima_calc_boot_aggregate() in ima_eventdigest_init() Roberto Sassu
2020-06-03 22:03   ` Mimi Zohar
2020-06-04 19:12     ` Bruno Meneguele
2020-06-04 19:35       ` Mimi Zohar
2020-06-04 19:57         ` Bruno Meneguele
2020-06-03 21:30 ` Mimi Zohar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1591219822.5146.2.camel@linux.ibm.com \
    --to=zohar@linux.ibm.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=roberto.sassu@huawei.com \
    --cc=silviu.vlasceanu@huawei.com \
    --cc=stable@vger.kernel.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).