From: Greg KH <gregkh@linuxfoundation.org>
To: "Guozihua (Scott)" <guozihua@huawei.com>
Cc: Mimi Zohar <zohar@linux.ibm.com>,
dmitry.kasatkin@gmail.com, Paul Moore <paul@paul-moore.com>,
sds@tycho.nsa.gov, eparis@parisplace.org, sashal@kernel.org,
selinux@vger.kernel.org,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
stable@vger.kernel.org
Subject: Re: [RFC] IMA LSM based rule race condition issue on 4.19 LTS
Date: Fri, 9 Dec 2022 11:27:23 +0100 [thread overview]
Message-ID: <Y5MNi85uzgXIMxX2@kroah.com> (raw)
In-Reply-To: <415d44a2-33a1-c100-1ffc-ad6f1409afd8@huawei.com>
On Fri, Dec 09, 2022 at 05:38:00PM +0800, Guozihua (Scott) wrote:
> On 2022/12/9 17:32, Guozihua (Scott) wrote:
> > On 2022/12/9 17:22, Greg KH wrote:
> >> On Fri, Dec 09, 2022 at 05:11:40PM +0800, Guozihua (Scott) wrote:
> >>> On 2022/12/9 17:00, Greg KH wrote:
> >>>> On Fri, Dec 09, 2022 at 04:59:17PM +0800, Guozihua (Scott) wrote:
> >>>>> On 2022/12/9 16:46, Greg KH wrote:
> >>>>>> On Fri, Dec 09, 2022 at 03:53:25PM +0800, Guozihua (Scott) wrote:
> >>>>>>> On 2022/12/9 15:12, Greg KH wrote:
> >>>>>>>> On Fri, Dec 09, 2022 at 03:00:35PM +0800, Guozihua (Scott) wrote:
> >>>>>>>>> Hi community.
> >>>>>>>>>
> >>>>>>>>> Previously our team reported a race condition in IMA relates to LSM based
> >>>>>>>>> rules which would case IMA to match files that should be filtered out under
> >>>>>>>>> normal condition. The issue was originally analyzed and fixed on mainstream.
> >>>>>>>>> The patch and the discussion could be found here:
> >>>>>>>>> https://lore.kernel.org/all/20220921125804.59490-1-guozihua@huawei.com/
> >>>>>>>>>
> >>>>>>>>> After that, we did a regression test on 4.19 LTS and the same issue arises.
> >>>>>>>>> Further analysis reveled that the issue is from a completely different
> >>>>>>>>> cause.
> >>>>>>>>
> >>>>>>>> What commit in the tree fixed this in newer kernels? Why can't we just
> >>>>>>>> backport that one to 4.19.y as well?
> >>>>>>>>
> >>>>>>>> thanks,
> >>>>>>>>
> >>>>>>>> greg k-h
> >>>>>>>
> >>>>>>> Hi Greg,
> >>>>>>>
> >>>>>>> The fix for mainline is now on linux-next, commit d57378d3aa4d ("ima:
> >>>>>>> Simplify ima_lsm_copy_rule") and c7423dbdbc9ece ("ima: Handle -ESTALE
> >>>>>>> returned by ima_filter_rule_match()"). However, these patches cannot be
> >>>>>>> picked directly into 4.19.y due to code difference.
> >>>>>>
> >>>>>> Ok, so it's much more than just 4.19 that's an issue here. And are
> >>>>>> those commits tagged for stable inclusion?
> >>>>>
> >>>>> Not actually, not on the commit itself.
> >>>>
> >>>> That's not good. When they hit Linus's tree, please submit backports to
> >>>> the stable mailing list so that they can be picked up.
> >>> Thing is these commits cannot be simply backported to 4.19.y. Preceding
> >>> patches are missing. How do we do backporting in this situation? Do we
> >>> first backport the preceding patches? Or maybe we develop another
> >>> solution for 4.19.y?
> >>
> >> First they need to go to newer kernel trees, and then worry about 4.19.
> >> We never want anyone to upgrade to a newer kernel and have a regression.
> >>
> >> Also, we can't do anything until they hit Linus's tree, as per the
> >> stable kernel rules.
> > Alright. We'll wait for these patches to be in Linus' tree. But should
> > we stick to a backport from mainstream or we form a different solution
> > for LTS?
We always want to have a normal backport of what is in Linus's tree if
at all possible. Whenever we diverge from that, we almost always get it
wrong and have to fix it up again later.
> BTW, I have a look into it and if we are backporting mainstream's
> solution, we would also needs to backport b16942455193 ("ima: use the
> lsm policy update notifier")
That's fine, please just send a patch series to the stable list when
needed.
thanks,
greg k-h
next prev parent reply other threads:[~2022-12-09 10:27 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-09 7:00 [RFC] IMA LSM based rule race condition issue on 4.19 LTS Guozihua (Scott)
2022-12-09 7:12 ` Greg KH
2022-12-09 7:53 ` Guozihua (Scott)
2022-12-09 8:46 ` Greg KH
2022-12-09 8:59 ` Guozihua (Scott)
2022-12-09 9:00 ` Greg KH
2022-12-09 9:11 ` Guozihua (Scott)
2022-12-09 9:22 ` Greg KH
2022-12-09 9:32 ` Guozihua (Scott)
2022-12-09 9:38 ` Guozihua (Scott)
2022-12-09 10:27 ` Greg KH [this message]
2022-12-12 2:39 ` Guozihua (Scott)
2022-12-13 15:30 ` Mimi Zohar
2022-12-14 1:33 ` Guozihua (Scott)
2022-12-14 12:19 ` Mimi Zohar
2022-12-15 8:51 ` Guozihua (Scott)
2022-12-15 10:49 ` Mimi Zohar
2022-12-15 13:15 ` Guozihua (Scott)
2022-12-15 14:30 ` Mimi Zohar
2022-12-15 21:04 ` Paul Moore
2022-12-16 2:36 ` Guozihua (Scott)
2022-12-16 3:04 ` Paul Moore
2022-12-19 7:10 ` Guozihua (Scott)
2022-12-19 13:11 ` Mimi Zohar
2022-12-20 1:11 ` Guozihua (Scott)
2022-12-21 10:51 ` Guozihua (Scott)
2022-12-23 8:04 ` Guozihua (Scott)
2022-12-24 3:41 ` Guozihua (Scott)
2022-12-24 7:47 ` Guozihua (Scott)
2023-01-06 1:05 ` Mimi Zohar
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=Y5MNi85uzgXIMxX2@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dmitry.kasatkin@gmail.com \
--cc=eparis@parisplace.org \
--cc=guozihua@huawei.com \
--cc=linux-integrity@vger.kernel.org \
--cc=paul@paul-moore.com \
--cc=sashal@kernel.org \
--cc=sds@tycho.nsa.gov \
--cc=selinux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=zohar@linux.ibm.com \
/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