* kasan patches
@ 2018-08-06 21:08 Nick Desaulniers
2018-08-11 16:40 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Nick Desaulniers @ 2018-08-06 21:08 UTC (permalink / raw)
To: stable; +Cc: Sami Tolvanen, Andrey Konovalov
These patches are needed for kasan+clang support. I confirmed they
apply cleanly in order (top to bottom):
4.9:
commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
4.4:
commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
===
0e410e158e5b is the one I'm interested in. Looks like it landed in
4.16, and got backported to 4.14-stable.
===
c5caf21ab0cf8 depends on c6d308534aef6 ("UBSAN: run-time undefined
behavior sanity checker"), and I don't want to bring in all of UBSAN
to 4.4. I'll send a patch for 0e410e158e5b.
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-06 21:08 kasan patches Nick Desaulniers
@ 2018-08-11 16:40 ` Greg KH
2018-08-13 21:25 ` Nick Desaulniers
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2018-08-11 16:40 UTC (permalink / raw)
To: Nick Desaulniers; +Cc: stable, Sami Tolvanen, Andrey Konovalov
On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> These patches are needed for kasan+clang support. I confirmed they
> apply cleanly in order (top to bottom):
>
> 4.9:
> commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
> commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
By applying these, I get a ton of new build warnings, so I can't add
them :(
> 4.4:
> commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
I'm guessing I will get build warnings here too :(
> ===
>
> 0e410e158e5b is the one I'm interested in. Looks like it landed in
> 4.16, and got backported to 4.14-stable.
>
> ===
>
> c5caf21ab0cf8 depends on c6d308534aef6 ("UBSAN: run-time undefined
> behavior sanity checker"), and I don't want to bring in all of UBSAN
> to 4.4. I'll send a patch for 0e410e158e5b.
I don't undersand, can you send a patch series for the patches you want
to have applied? That makes it easier to understand.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-11 16:40 ` Greg KH
@ 2018-08-13 21:25 ` Nick Desaulniers
2018-08-14 7:24 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Nick Desaulniers @ 2018-08-13 21:25 UTC (permalink / raw)
To: Greg KH; +Cc: stable, Sami Tolvanen, Andrey Konovalov
On Sat, Aug 11, 2018 at 9:40 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> > These patches are needed for kasan+clang support. I confirmed they
> > apply cleanly in order (top to bottom):
> >
> > 4.9:
> > commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
> > commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
>
> By applying these, I get a ton of new build warnings, so I can't add
> them :(
What? Such innocent patches.
$ git remote add stable
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
$ git checkout -b 4.9-stable-kasan stable/linux-4.9.y
<git log shows 4.9.118>
$ git cherry-pick c5caf21ab0cf8
$ git cherry-pick 0e410e158e5b
$ make defconfig
$ make -j46
I get -Wstringop-truncation, -Wstringop-overflow=,
-Wpacked-not-aligned, -Warray-bounds warnings with gcc-8 with or
without these patches.
Can you share your config, or what the warning was? Did I checkout
the wrong branch?
>
> > 4.4:
> > commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
>
> I'm guessing I will get build warnings here too :(
>
> > ===
> >
> > 0e410e158e5b is the one I'm interested in. Looks like it landed in
> > 4.16, and got backported to 4.14-stable.
> >
> > ===
> >
> > c5caf21ab0cf8 depends on c6d308534aef6 ("UBSAN: run-time undefined
> > behavior sanity checker"), and I don't want to bring in all of UBSAN
> > to 4.4. I'll send a patch for 0e410e158e5b.
>
> I don't undersand, can you send a patch series for the patches you want
> to have applied? That makes it easier to understand.
Yes, sorry, I'll do that for 4.4 once we figure out what the 4.9 issues are.
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-13 21:25 ` Nick Desaulniers
@ 2018-08-14 7:24 ` Greg KH
2018-08-14 7:37 ` Greg KH
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2018-08-14 7:24 UTC (permalink / raw)
To: Nick Desaulniers; +Cc: stable, Sami Tolvanen, Andrey Konovalov
On Mon, Aug 13, 2018 at 02:25:12PM -0700, Nick Desaulniers wrote:
> On Sat, Aug 11, 2018 at 9:40 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> > > These patches are needed for kasan+clang support. I confirmed they
> > > apply cleanly in order (top to bottom):
> > >
> > > 4.9:
> > > commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
> > > commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
> >
> > By applying these, I get a ton of new build warnings, so I can't add
> > them :(
>
> What? Such innocent patches.
>
> $ git remote add stable
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> $ git checkout -b 4.9-stable-kasan stable/linux-4.9.y
> <git log shows 4.9.118>
> $ git cherry-pick c5caf21ab0cf8
> $ git cherry-pick 0e410e158e5b
> $ make defconfig
> $ make -j46
>
> I get -Wstringop-truncation, -Wstringop-overflow=,
> -Wpacked-not-aligned, -Warray-bounds warnings with gcc-8 with or
> without these patches.
>
> Can you share your config, or what the warning was? Did I checkout
> the wrong branch?
I used 'make allmodconfig' on a x86 Fedora 27 release which is using gcc
7.3.1. Adding those patches adds a ton of warnings. Let me go do a
test build and send you the full log...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-14 7:24 ` Greg KH
@ 2018-08-14 7:37 ` Greg KH
2018-08-14 12:44 ` Andrey Konovalov
0 siblings, 1 reply; 10+ messages in thread
From: Greg KH @ 2018-08-14 7:37 UTC (permalink / raw)
To: Nick Desaulniers; +Cc: stable, Sami Tolvanen, Andrey Konovalov
[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]
On Tue, Aug 14, 2018 at 09:24:29AM +0200, Greg KH wrote:
> On Mon, Aug 13, 2018 at 02:25:12PM -0700, Nick Desaulniers wrote:
> > On Sat, Aug 11, 2018 at 9:40 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> > > > These patches are needed for kasan+clang support. I confirmed they
> > > > apply cleanly in order (top to bottom):
> > > >
> > > > 4.9:
> > > > commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
> > > > commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
> > >
> > > By applying these, I get a ton of new build warnings, so I can't add
> > > them :(
> >
> > What? Such innocent patches.
> >
> > $ git remote add stable
> > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> > $ git checkout -b 4.9-stable-kasan stable/linux-4.9.y
> > <git log shows 4.9.118>
> > $ git cherry-pick c5caf21ab0cf8
> > $ git cherry-pick 0e410e158e5b
> > $ make defconfig
> > $ make -j46
> >
> > I get -Wstringop-truncation, -Wstringop-overflow=,
> > -Wpacked-not-aligned, -Warray-bounds warnings with gcc-8 with or
> > without these patches.
> >
> > Can you share your config, or what the warning was? Did I checkout
> > the wrong branch?
>
> I used 'make allmodconfig' on a x86 Fedora 27 release which is using gcc
> 7.3.1. Adding those patches adds a ton of warnings. Let me go do a
> test build and send you the full log...
Attached is the full build log. Before those 2 patches were added, no
build warnings. Afterward, I now have 148 build warnings. So something
is not right here.
thanks,
greg k-h
[-- Attachment #2: log.gz --]
[-- Type: application/gzip, Size: 194927 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-14 7:37 ` Greg KH
@ 2018-08-14 12:44 ` Andrey Konovalov
2018-08-14 13:51 ` Greg KH
2018-08-14 20:33 ` Nick Desaulniers
0 siblings, 2 replies; 10+ messages in thread
From: Andrey Konovalov @ 2018-08-14 12:44 UTC (permalink / raw)
To: Greg KH; +Cc: Nick Desaulniers, stable, Sami Tolvanen, Dmitry Vyukov
On Tue, Aug 14, 2018 at 9:37 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Tue, Aug 14, 2018 at 09:24:29AM +0200, Greg KH wrote:
>> On Mon, Aug 13, 2018 at 02:25:12PM -0700, Nick Desaulniers wrote:
>> > On Sat, Aug 11, 2018 at 9:40 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>> > >
>> > > On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
>> > > > These patches are needed for kasan+clang support. I confirmed they
>> > > > apply cleanly in order (top to bottom):
>> > > >
>> > > > 4.9:
>> > > > commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
>> > > > commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
>> > >
>> > > By applying these, I get a ton of new build warnings, so I can't add
>> > > them :(
>> >
>> > What? Such innocent patches.
>> >
>> > $ git remote add stable
>> > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
>> > $ git checkout -b 4.9-stable-kasan stable/linux-4.9.y
>> > <git log shows 4.9.118>
>> > $ git cherry-pick c5caf21ab0cf8
>> > $ git cherry-pick 0e410e158e5b
>> > $ make defconfig
>> > $ make -j46
>> >
>> > I get -Wstringop-truncation, -Wstringop-overflow=,
>> > -Wpacked-not-aligned, -Warray-bounds warnings with gcc-8 with or
>> > without these patches.
>> >
>> > Can you share your config, or what the warning was? Did I checkout
>> > the wrong branch?
>>
>> I used 'make allmodconfig' on a x86 Fedora 27 release which is using gcc
>> 7.3.1. Adding those patches adds a ton of warnings. Let me go do a
>> test build and send you the full log...
>
> Attached is the full build log. Before those 2 patches were added, no
> build warnings. Afterward, I now have 148 build warnings. So something
> is not right here.
I think the issue here is that e7c52b84fb ("kasan: rework Kconfig
settings") should have been backported after c5caf21ab0cf8 ("kasan:
turn on -fsanitize-address-use-after-scope"). You'll need to
"rebackport" the former one (hide use-after-scope under
CONFIG_KASAN_EXTRA and set FRAME_WARN to 3072 with KASAN_EXTRA).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-14 12:44 ` Andrey Konovalov
@ 2018-08-14 13:51 ` Greg KH
2018-08-14 20:33 ` Nick Desaulniers
1 sibling, 0 replies; 10+ messages in thread
From: Greg KH @ 2018-08-14 13:51 UTC (permalink / raw)
To: Andrey Konovalov; +Cc: Nick Desaulniers, stable, Sami Tolvanen, Dmitry Vyukov
On Tue, Aug 14, 2018 at 02:44:19PM +0200, Andrey Konovalov wrote:
> On Tue, Aug 14, 2018 at 9:37 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Tue, Aug 14, 2018 at 09:24:29AM +0200, Greg KH wrote:
> >> On Mon, Aug 13, 2018 at 02:25:12PM -0700, Nick Desaulniers wrote:
> >> > On Sat, Aug 11, 2018 at 9:40 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > >
> >> > > On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> >> > > > These patches are needed for kasan+clang support. I confirmed they
> >> > > > apply cleanly in order (top to bottom):
> >> > > >
> >> > > > 4.9:
> >> > > > commit c5caf21ab0cf8 ("kasan: turn on -fsanitize-address-use-after-scope")
> >> > > > commit 0e410e158e5b ("kasan: don't emit builtin calls when sanitization is off")
> >> > >
> >> > > By applying these, I get a ton of new build warnings, so I can't add
> >> > > them :(
> >> >
> >> > What? Such innocent patches.
> >> >
> >> > $ git remote add stable
> >> > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
> >> > $ git checkout -b 4.9-stable-kasan stable/linux-4.9.y
> >> > <git log shows 4.9.118>
> >> > $ git cherry-pick c5caf21ab0cf8
> >> > $ git cherry-pick 0e410e158e5b
> >> > $ make defconfig
> >> > $ make -j46
> >> >
> >> > I get -Wstringop-truncation, -Wstringop-overflow=,
> >> > -Wpacked-not-aligned, -Warray-bounds warnings with gcc-8 with or
> >> > without these patches.
> >> >
> >> > Can you share your config, or what the warning was? Did I checkout
> >> > the wrong branch?
> >>
> >> I used 'make allmodconfig' on a x86 Fedora 27 release which is using gcc
> >> 7.3.1. Adding those patches adds a ton of warnings. Let me go do a
> >> test build and send you the full log...
> >
> > Attached is the full build log. Before those 2 patches were added, no
> > build warnings. Afterward, I now have 148 build warnings. So something
> > is not right here.
>
> I think the issue here is that e7c52b84fb ("kasan: rework Kconfig
> settings") should have been backported after c5caf21ab0cf8 ("kasan:
> turn on -fsanitize-address-use-after-scope"). You'll need to
> "rebackport" the former one (hide use-after-scope under
> CONFIG_KASAN_EXTRA and set FRAME_WARN to 3072 with KASAN_EXTRA).
Again, if someone could send me a patch series that are properly
backported, it would make everything a lot easier and allow these
patches to actually be applied :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-14 12:44 ` Andrey Konovalov
2018-08-14 13:51 ` Greg KH
@ 2018-08-14 20:33 ` Nick Desaulniers
2018-08-14 20:56 ` Arnd Bergmann
1 sibling, 1 reply; 10+ messages in thread
From: Nick Desaulniers @ 2018-08-14 20:33 UTC (permalink / raw)
To: Andrey Konovalov
Cc: Greg KH, stable, Sami Tolvanen, Dmitry Vyukov, Arnd Bergmann
+Arnd
On Tue, Aug 14, 2018 at 5:44 AM Andrey Konovalov <andreyknvl@google.com> wrote:
> >> > > On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> >> > $ git cherry-pick c5caf21ab0cf8
> >> > $ git cherry-pick 0e410e158e5b
>
> I think the issue here is that e7c52b84fb ("kasan: rework Kconfig
> settings") should have been backported after c5caf21ab0cf8 ("kasan:
> turn on -fsanitize-address-use-after-scope"). You'll need to
> "rebackport" the former one (hide use-after-scope under
> CONFIG_KASAN_EXTRA and set FRAME_WARN to 3072 with KASAN_EXTRA).
It looks like e7c52b84fb is already in the 4.9 tree as commit
ef3af3465ab4, partially.
Oh, I see what you mean by "rebackport."
Greg, I'm happy to send the patch set. Do you (or anyone else)
recommend sending a revert of ef3af3465ab4 + a new patch, or just a
new patch?
Do you expect anything in the commit message that denotes how whether
a patch applied cleanly or required manual intervention?
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-14 20:33 ` Nick Desaulniers
@ 2018-08-14 20:56 ` Arnd Bergmann
2018-08-14 22:04 ` Nick Desaulniers
0 siblings, 1 reply; 10+ messages in thread
From: Arnd Bergmann @ 2018-08-14 20:56 UTC (permalink / raw)
To: Nick Desaulniers
Cc: Andrey Konovalov, gregkh, # 3.4.x, Sami Tolvanen, Dmitry Vyukov
On Tue, Aug 14, 2018 at 10:34 PM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> +Arnd
>
> On Tue, Aug 14, 2018 at 5:44 AM Andrey Konovalov <andreyknvl@google.com> wrote:
> > >> > > On Mon, Aug 06, 2018 at 02:08:32PM -0700, Nick Desaulniers wrote:
> > >> > $ git cherry-pick c5caf21ab0cf8
> > >> > $ git cherry-pick 0e410e158e5b
> >
> > I think the issue here is that e7c52b84fb ("kasan: rework Kconfig
> > settings") should have been backported after c5caf21ab0cf8 ("kasan:
> > turn on -fsanitize-address-use-after-scope"). You'll need to
> > "rebackport" the former one (hide use-after-scope under
> > CONFIG_KASAN_EXTRA and set FRAME_WARN to 3072 with KASAN_EXTRA).
>
> It looks like e7c52b84fb is already in the 4.9 tree as commit
> ef3af3465ab4, partially.
>
> Oh, I see what you mean by "rebackport."
>
> Greg, I'm happy to send the patch set. Do you (or anyone else)
> recommend sending a revert of ef3af3465ab4 + a new patch, or just a
> new patch?
>
> Do you expect anything in the commit message that denotes how whether
> a patch applied cleanly or required manual intervention?
I'm missing the background on what you are trying to do here. Do you actually
want to use the -fsanitize-address-use-after-scope feature that got added
later, or do you just need the -fno-builtin option? In the latter case, I think
the easiest solution would be to do a manual backport of 0e410e158e5b
by itself, adjusting for context, and describing what you have done in the
changelog.
Arnd
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kasan patches
2018-08-14 20:56 ` Arnd Bergmann
@ 2018-08-14 22:04 ` Nick Desaulniers
0 siblings, 0 replies; 10+ messages in thread
From: Nick Desaulniers @ 2018-08-14 22:04 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Andrey Konovalov, Greg KH, stable, Sami Tolvanen, Dmitry Vyukov
On Tue, Aug 14, 2018 at 1:56 PM Arnd Bergmann <arnd@arndb.de> wrote:
> I'm missing the background on what you are trying to do here.
Sorry, comments
https://android-review.googlesource.com/c/kernel/common/+/725213 have
more context.
> Do you actually
> want to use the -fsanitize-address-use-after-scope feature that got added
> later, or do you just need the -fno-builtin option? In the latter case, I think
> the easiest solution would be to do a manual backport of 0e410e158e5b
> by itself, adjusting for context, and describing what you have done in the
> changelog.
Thanks for the recommendation, I was definitely over thinking this. Sent:
https://www.spinics.net/lists/stable/msg251682.html: [PATCH 4.9]
kasan: don't emit builtin calls when sanitization is off
https://www.spinics.net/lists/stable/msg251683.html: [PATCH 4.4]
kasan: don't emit builtin calls when sanitization is off
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2018-08-15 0:53 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-06 21:08 kasan patches Nick Desaulniers
2018-08-11 16:40 ` Greg KH
2018-08-13 21:25 ` Nick Desaulniers
2018-08-14 7:24 ` Greg KH
2018-08-14 7:37 ` Greg KH
2018-08-14 12:44 ` Andrey Konovalov
2018-08-14 13:51 ` Greg KH
2018-08-14 20:33 ` Nick Desaulniers
2018-08-14 20:56 ` Arnd Bergmann
2018-08-14 22:04 ` Nick Desaulniers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox