linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* stable: KASan for ARM
@ 2021-03-07 15:00 Michał Mirosław
  2021-03-07 15:20 ` Greg Kroah-Hartman
  2021-03-08  9:44 ` Linus Walleij
  0 siblings, 2 replies; 9+ messages in thread
From: Michał Mirosław @ 2021-03-07 15:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Linus Walleij, stable, linux-arm-kernel

Dear Greg,

Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
are 7a1be318f579..421015713b30 if I understand correctly. They are
not normal stable material, but I think they will help tremendously in
discovering kernel bugs on 32-bit ARMs.

Best Regards
Michał Mirosław

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 15:00 stable: KASan for ARM Michał Mirosław
@ 2021-03-07 15:20 ` Greg Kroah-Hartman
  2021-03-07 16:10   ` Ard Biesheuvel
  2021-03-08  9:44 ` Linus Walleij
  1 sibling, 1 reply; 9+ messages in thread
From: Greg Kroah-Hartman @ 2021-03-07 15:20 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: Linus Walleij, stable, linux-arm-kernel

On Sun, Mar 07, 2021 at 04:00:40PM +0100, Michał Mirosław wrote:
> Dear Greg,
> 
> Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> are 7a1be318f579..421015713b30 if I understand correctly. They are
> not normal stable material, but I think they will help tremendously in
> discovering kernel bugs on 32-bit ARMs.

Looks like a new feature to me, right?

How many patches, and have you tested them?  If so, submit them as a
patch series and we can review them, but if this is a new feature, it
does not meet the stable kernel rules.

And why not just use 5.11 or newer for discovering kernel bugs?  Why
does 5.10 matter here?

thanks,

greg k-h

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 15:20 ` Greg Kroah-Hartman
@ 2021-03-07 16:10   ` Ard Biesheuvel
  2021-03-07 22:48     ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 9+ messages in thread
From: Ard Biesheuvel @ 2021-03-07 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Russell King
  Cc: Michał Mirosław, Linus Walleij, stable, Linux ARM

(+ Russell)

On Sun, 7 Mar 2021 at 16:21, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Sun, Mar 07, 2021 at 04:00:40PM +0100, Michał Mirosław wrote:
> > Dear Greg,
> >
> > Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> > are 7a1be318f579..421015713b30 if I understand correctly. They are
> > not normal stable material, but I think they will help tremendously in
> > discovering kernel bugs on 32-bit ARMs.
>
> Looks like a new feature to me, right?
>
> How many patches, and have you tested them?  If so, submit them as a
> patch series and we can review them, but if this is a new feature, it
> does not meet the stable kernel rules.
>
> And why not just use 5.11 or newer for discovering kernel bugs?  Why
> does 5.10 matter here?
>

The KASan support was rather tricky to get right, so I don't think
this is suitable for stable. The range 7a1be318f579..421015713b30 is
definitely not complete (we'd need at least
e9a2f8b599d0bc22a1b13e69527246ac39c697b4 and
10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 as well), and the intrusive
nature of those changes means they are definitely not appropriate as
stable backports.

-- 
Ard.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 16:10   ` Ard Biesheuvel
@ 2021-03-07 22:48     ` Russell King - ARM Linux admin
  2021-03-07 23:34       ` Michał Mirosław
  0 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux admin @ 2021-03-07 22:48 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Greg Kroah-Hartman, Michał Mirosław, Linus Walleij,
	stable, Linux ARM

On Sun, Mar 07, 2021 at 05:10:43PM +0100, Ard Biesheuvel wrote:
> (+ Russell)
> 
> On Sun, 7 Mar 2021 at 16:21, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > On Sun, Mar 07, 2021 at 04:00:40PM +0100, Michał Mirosław wrote:
> > > Dear Greg,
> > >
> > > Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> > > are 7a1be318f579..421015713b30 if I understand correctly. They are
> > > not normal stable material, but I think they will help tremendously in
> > > discovering kernel bugs on 32-bit ARMs.
> >
> > Looks like a new feature to me, right?
> >
> > How many patches, and have you tested them?  If so, submit them as a
> > patch series and we can review them, but if this is a new feature, it
> > does not meet the stable kernel rules.
> >
> > And why not just use 5.11 or newer for discovering kernel bugs?  Why
> > does 5.10 matter here?
> >
> 
> The KASan support was rather tricky to get right, so I don't think
> this is suitable for stable. The range 7a1be318f579..421015713b30 is
> definitely not complete (we'd need at least
> e9a2f8b599d0bc22a1b13e69527246ac39c697b4 and
> 10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 as well), and the intrusive
> nature of those changes means they are definitely not appropriate as
> stable backports.

I agree - it took quite a while for KASan to settle down - and our last
issue with KASan causing a panic in the Kprobes codes was in February.
So, I think at the very least, requesting to backport this so soon is
premature. That fix is not included even in what you mention above.
Maybe that fix has already been picked up in stable, I don't know.

So, we know that there's probably more to getting kprobes working on
32-bit ARM than even you've mentioned above.

Is it worth backporting such a major feature to stable kernels? Or
would it be better to backport the fixes found by KASan from later
kernels? My feeling is the latter is the better all round approach.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 22:48     ` Russell King - ARM Linux admin
@ 2021-03-07 23:34       ` Michał Mirosław
  2021-03-08  0:42         ` Sasha Levin
  2021-03-08  6:13         ` Greg Kroah-Hartman
  0 siblings, 2 replies; 9+ messages in thread
From: Michał Mirosław @ 2021-03-07 23:34 UTC (permalink / raw)
  To: Russell King - ARM Linux admin, Ard Biesheuvel,
	Greg Kroah-Hartman, Linus Walleij
  Cc: stable, Linux ARM

On Sun, Mar 07, 2021 at 10:48:54PM +0000, Russell King - ARM Linux admin wrote:
> On Sun, Mar 07, 2021 at 05:10:43PM +0100, Ard Biesheuvel wrote:
> > (+ Russell)
> > 
> > On Sun, 7 Mar 2021 at 16:21, Greg Kroah-Hartman
> > <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Sun, Mar 07, 2021 at 04:00:40PM +0100, Michał Mirosław wrote:
> > > > Dear Greg,
> > > >
> > > > Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> > > > are 7a1be318f579..421015713b30 if I understand correctly. They are
> > > > not normal stable material, but I think they will help tremendously in
> > > > discovering kernel bugs on 32-bit ARMs.
> > >
> > > Looks like a new feature to me, right?
> > >
> > > How many patches, and have you tested them?  If so, submit them as a
> > > patch series and we can review them, but if this is a new feature, it
> > > does not meet the stable kernel rules.
> > >
> > > And why not just use 5.11 or newer for discovering kernel bugs?  Why
> > > does 5.10 matter here?
> > 
> > The KASan support was rather tricky to get right, so I don't think
> > this is suitable for stable. The range 7a1be318f579..421015713b30 is
> > definitely not complete (we'd need at least
> > e9a2f8b599d0bc22a1b13e69527246ac39c697b4 and
> > 10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 as well), and the intrusive
> > nature of those changes means they are definitely not appropriate as
> > stable backports.
> 
> I agree - it took quite a while for KASan to settle down - and our last
> issue with KASan causing a panic in the Kprobes codes was in February.
> So, I think at the very least, requesting to backport this so soon is
> premature. That fix is not included even in what you mention above.
> Maybe that fix has already been picked up in stable, I don't know.
> 
> So, we know that there's probably more to getting kprobes working on
> 32-bit ARM than even you've mentioned above.
> 
> Is it worth backporting such a major feature to stable kernels? Or
> would it be better to backport the fixes found by KASan from later
> kernels? My feeling is the latter is the better all round approach.

I guessed that KASan support code does not pose problems with
CONFIG_KASAN=n.  If it does, then I understand that this is definitely
a deal-breaker for stable, and I agree there is no point in further
discussion. But, if in disabled state KASan patches meet the stable
requirements, then maybe it is worth the trouble to help those who
have to stay on a LTS kernel?

Regarding testing KASan for ARM: I'm currently running it on a SAMA5D2
board. The 4 patches on top of v5.10.21 did allow the device to boot up
(after fixing a false-positive in __clear_user_memset()).  I also applied
the three patches Ard mentioned just to be closer to upstream and the
board still went up. Kernel gets big and slow after enabling KASan,
but I think this is expected.

Best Regards
Michał Mirosław

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 23:34       ` Michał Mirosław
@ 2021-03-08  0:42         ` Sasha Levin
  2021-03-08  6:13         ` Greg Kroah-Hartman
  1 sibling, 0 replies; 9+ messages in thread
From: Sasha Levin @ 2021-03-08  0:42 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Russell King - ARM Linux admin, Ard Biesheuvel,
	Greg Kroah-Hartman, Linus Walleij, stable, Linux ARM

On Mon, Mar 08, 2021 at 12:34:39AM +0100, Michał Mirosław wrote:
>On Sun, Mar 07, 2021 at 10:48:54PM +0000, Russell King - ARM Linux admin wrote:
>> On Sun, Mar 07, 2021 at 05:10:43PM +0100, Ard Biesheuvel wrote:
>> > (+ Russell)
>> >
>> > On Sun, 7 Mar 2021 at 16:21, Greg Kroah-Hartman
>> > <gregkh@linuxfoundation.org> wrote:
>> > >
>> > > On Sun, Mar 07, 2021 at 04:00:40PM +0100, Michał Mirosław wrote:
>> > > > Dear Greg,
>> > > >
>> > > > Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
>> > > > are 7a1be318f579..421015713b30 if I understand correctly. They are
>> > > > not normal stable material, but I think they will help tremendously in
>> > > > discovering kernel bugs on 32-bit ARMs.
>> > >
>> > > Looks like a new feature to me, right?
>> > >
>> > > How many patches, and have you tested them?  If so, submit them as a
>> > > patch series and we can review them, but if this is a new feature, it
>> > > does not meet the stable kernel rules.
>> > >
>> > > And why not just use 5.11 or newer for discovering kernel bugs?  Why
>> > > does 5.10 matter here?
>> >
>> > The KASan support was rather tricky to get right, so I don't think
>> > this is suitable for stable. The range 7a1be318f579..421015713b30 is
>> > definitely not complete (we'd need at least
>> > e9a2f8b599d0bc22a1b13e69527246ac39c697b4 and
>> > 10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 as well), and the intrusive
>> > nature of those changes means they are definitely not appropriate as
>> > stable backports.
>>
>> I agree - it took quite a while for KASan to settle down - and our last
>> issue with KASan causing a panic in the Kprobes codes was in February.
>> So, I think at the very least, requesting to backport this so soon is
>> premature. That fix is not included even in what you mention above.
>> Maybe that fix has already been picked up in stable, I don't know.
>>
>> So, we know that there's probably more to getting kprobes working on
>> 32-bit ARM than even you've mentioned above.
>>
>> Is it worth backporting such a major feature to stable kernels? Or
>> would it be better to backport the fixes found by KASan from later
>> kernels? My feeling is the latter is the better all round approach.
>
>I guessed that KASan support code does not pose problems with
>CONFIG_KASAN=n.  If it does, then I understand that this is definitely
>a deal-breaker for stable, and I agree there is no point in further
>discussion. But, if in disabled state KASan patches meet the stable
>requirements, then maybe it is worth the trouble to help those who
>have to stay on a LTS kernel?

Following this logic nearly every upstream feature can be backported to
stable.

You can't have both worlds; you can't stay on an older "stable" tree
while still benefiting from new features that land upstream.

-- 
Thanks,
Sasha

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 23:34       ` Michał Mirosław
  2021-03-08  0:42         ` Sasha Levin
@ 2021-03-08  6:13         ` Greg Kroah-Hartman
  1 sibling, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2021-03-08  6:13 UTC (permalink / raw)
  To: Michał Mirosław
  Cc: Russell King - ARM Linux admin, Ard Biesheuvel, Linus Walleij,
	stable, Linux ARM

On Mon, Mar 08, 2021 at 12:34:39AM +0100, Michał Mirosław wrote:
> On Sun, Mar 07, 2021 at 10:48:54PM +0000, Russell King - ARM Linux admin wrote:
> > On Sun, Mar 07, 2021 at 05:10:43PM +0100, Ard Biesheuvel wrote:
> > > (+ Russell)
> > > 
> > > On Sun, 7 Mar 2021 at 16:21, Greg Kroah-Hartman
> > > <gregkh@linuxfoundation.org> wrote:
> > > >
> > > > On Sun, Mar 07, 2021 at 04:00:40PM +0100, Michał Mirosław wrote:
> > > > > Dear Greg,
> > > > >
> > > > > Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> > > > > are 7a1be318f579..421015713b30 if I understand correctly. They are
> > > > > not normal stable material, but I think they will help tremendously in
> > > > > discovering kernel bugs on 32-bit ARMs.
> > > >
> > > > Looks like a new feature to me, right?
> > > >
> > > > How many patches, and have you tested them?  If so, submit them as a
> > > > patch series and we can review them, but if this is a new feature, it
> > > > does not meet the stable kernel rules.
> > > >
> > > > And why not just use 5.11 or newer for discovering kernel bugs?  Why
> > > > does 5.10 matter here?
> > > 
> > > The KASan support was rather tricky to get right, so I don't think
> > > this is suitable for stable. The range 7a1be318f579..421015713b30 is
> > > definitely not complete (we'd need at least
> > > e9a2f8b599d0bc22a1b13e69527246ac39c697b4 and
> > > 10fce53c0ef8f6e79115c3d9e0d7ea1338c3fa37 as well), and the intrusive
> > > nature of those changes means they are definitely not appropriate as
> > > stable backports.
> > 
> > I agree - it took quite a while for KASan to settle down - and our last
> > issue with KASan causing a panic in the Kprobes codes was in February.
> > So, I think at the very least, requesting to backport this so soon is
> > premature. That fix is not included even in what you mention above.
> > Maybe that fix has already been picked up in stable, I don't know.
> > 
> > So, we know that there's probably more to getting kprobes working on
> > 32-bit ARM than even you've mentioned above.
> > 
> > Is it worth backporting such a major feature to stable kernels? Or
> > would it be better to backport the fixes found by KASan from later
> > kernels? My feeling is the latter is the better all round approach.
> 
> I guessed that KASan support code does not pose problems with
> CONFIG_KASAN=n.  If it does, then I understand that this is definitely
> a deal-breaker for stable, and I agree there is no point in further
> discussion. But, if in disabled state KASan patches meet the stable
> requirements, then maybe it is worth the trouble to help those who
> have to stay on a LTS kernel?

Please read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for what types of patches are acceptable for stable kernels.  These do
not seem to fit into those categories at all.

thanks,

greg k-h

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-07 15:00 stable: KASan for ARM Michał Mirosław
  2021-03-07 15:20 ` Greg Kroah-Hartman
@ 2021-03-08  9:44 ` Linus Walleij
  2021-03-08 22:51   ` Michał Mirosław
  1 sibling, 1 reply; 9+ messages in thread
From: Linus Walleij @ 2021-03-08  9:44 UTC (permalink / raw)
  To: Michał Mirosław; +Cc: Greg Kroah-Hartman, stable, Linux ARM

On Sun, Mar 7, 2021 at 4:00 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:

> Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> are 7a1be318f579..421015713b30 if I understand correctly. They are
> not normal stable material, but I think they will help tremendously in
> discovering kernel bugs on 32-bit ARMs.

It's a development feature not supposed to be enabled in production/product
kernels and following the stable kernel rules I don't see what this
code would achieve in stable.

IMO it's a better idea to provide a branch with KASan for each stable branch
that developers can pull in if they want to enable it and use it for testing.

Are you interested in setting up such branches for others to use?
I think it would be helpful. Also the work shouldn't be very hard after bring-up
and it ends when the last stable pre-v5.11 kernel is EOL:ed.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: stable: KASan for ARM
  2021-03-08  9:44 ` Linus Walleij
@ 2021-03-08 22:51   ` Michał Mirosław
  0 siblings, 0 replies; 9+ messages in thread
From: Michał Mirosław @ 2021-03-08 22:51 UTC (permalink / raw)
  To: Linus Walleij; +Cc: Greg Kroah-Hartman, stable, Linux ARM

On Mon, Mar 08, 2021 at 10:44:03AM +0100, Linus Walleij wrote:
> On Sun, Mar 7, 2021 at 4:00 PM Michał Mirosław <mirq-linux@rere.qmqm.pl> wrote:
> 
> > Would you consider KASan for ARM patches for LTS (5.10) kernel? Those
> > are 7a1be318f579..421015713b30 if I understand correctly. They are
> > not normal stable material, but I think they will help tremendously in
> > discovering kernel bugs on 32-bit ARMs.
> 
> It's a development feature not supposed to be enabled in production/product
> kernels and following the stable kernel rules I don't see what this
> code would achieve in stable.
> 
> IMO it's a better idea to provide a branch with KASan for each stable branch
> that developers can pull in if they want to enable it and use it for testing.
> 
> Are you interested in setting up such branches for others to use?
> I think it would be helpful. Also the work shouldn't be very hard after bring-up
> and it ends when the last stable pre-v5.11 kernel is EOL:ed.

This is just a few patches, so I've posted the branch at my git repo.
Please clone after fetching stable/linux-5.10.x from kernel.org:

	git remote add rere git://rere.qmqm.pl/linux
	git fetch rere refs/heads/kasan-for-arm-510

Best Regards,
Michał Mirosław

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-08 22:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07 15:00 stable: KASan for ARM Michał Mirosław
2021-03-07 15:20 ` Greg Kroah-Hartman
2021-03-07 16:10   ` Ard Biesheuvel
2021-03-07 22:48     ` Russell King - ARM Linux admin
2021-03-07 23:34       ` Michał Mirosław
2021-03-08  0:42         ` Sasha Levin
2021-03-08  6:13         ` Greg Kroah-Hartman
2021-03-08  9:44 ` Linus Walleij
2021-03-08 22:51   ` Michał Mirosław

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).