Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577780

Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line

From Dmitry Vyukov <dvyukov@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line
Date 2017-02-09 18:00 +0100
Message-ID <t90eB-98-17@gated-at.bofh.it> (permalink)
References <t8I83-5Aj-39@gated-at.bofh.it> <t8VeW-5zl-29@gated-at.bofh.it> <t8Vyj-5Gs-29@gated-at.bofh.it> <t8WkG-6dH-11@gated-at.bofh.it> <t8YcO-7mZ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Feb 9, 2017 at 3:33 PM, Arnd Bergmann <arnd@arndb.de> wrote:
>>>
>>> Thanks for the list, that looks very helpful. The ones I found myself
>>> seem to be a strict (and small) subset of those, using gcc-7.0.1 on x86-64
>>> with allmodconfig and a few hundred randconfig builds. Which compiler
>>> version did you use for your testing? If new versions are better than old
>>> ones, we could start by fixing the ones that are still present in gcc-6 and
>>> gcc-7, and making the warning conditionally on the compiler version.
>>>
>>> Another idea might be to separate out asan_stack=1 into a separate
>>> Kconfig option and warn if that is enabled with compilers that are known
>>> to be relatively bad it keeping the stack small.
>>
>>
>> Mine is gcc version 7.0.0 20161208. Make sure you enable KASAN_INLINE
>> and I also enabled CONFIG_KCOV. Other than that I just did
>> allyesconfig + make -k.
>
> Ok, I see my mistake now: On the allmodconfig build, I had KASAN_INLINE
> disabled, which made the problem go away for almost all files (almost all
> frame sizes are below 2048 bytes, except for the two issues I posted patches
> for (hisilicon ethernet driver, and nla_put_* users).
>
> On the randconfig build test, I have a long series of patches applied that
> address all known warnings, including my earlier "kasan: turn off
> -fsanitize-address-use-after-scope for now" (see
> https://patchwork.kernel.org/patch/9442323/). Without
> -fsanitize-address-use-after-scope, the problem is also mostly gone
> (a few cases show up in drivers/media/, and also in block/sed-opal.c
> and drivers/tty/vt/keyboard.c). I now have initial patches for all of
> them to bring the stack size below 2048 bytes.
>
> As far as I can see, the remaining problems with scary stack frame sizes
> you found only show up with the combination of all three: KASAN_INLINE,
> asan_stack=1 and -fsanitize-address-use-after-scope. If all three were
> separately configurable and we merge the patches I made, I think we could
> enable the normal 2048 byte warning in all configurations that have at least
> one of the turned off, but I don't know which of those combinations would
> actually be sensible for production kernels.

FWIW I use all of them (+KCOV which is additional instrumentation).
If you ask which is the least important one, it is
-fsanitize-address-use-after-scope. I have not see any single report
due to it (probably due to kernel coding style).

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] netlink: move nla_put_{u8,u16,u32} out of line Arnd Bergmann <arnd@arndb.de> - 2017-02-08 22:40 +0100
  Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Dmitry Vyukov <dvyukov@google.com> - 2017-02-09 12:40 +0100
    Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Arnd Bergmann <arnd@arndb.de> - 2017-02-09 13:00 +0100
      Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Dmitry Vyukov <dvyukov@google.com> - 2017-02-09 13:50 +0100
        Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Arnd Bergmann <arnd@arndb.de> - 2017-02-09 15:50 +0100
          Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Dmitry Vyukov <dvyukov@google.com> - 2017-02-09 18:00 +0100
            Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Arnd Bergmann <arnd@arndb.de> - 2017-02-09 18:10 +0100
              Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Arnd Bergmann <arnd@arndb.de> - 2017-02-10 14:40 +0100
                Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line Arnd Bergmann <arnd@arndb.de> - 2017-02-13 17:20 +0100
  Re: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line David Miller <davem@davemloft.net> - 2017-02-09 22:40 +0100
    RE: [PATCH] netlink: move nla_put_{u8,u16,u32} out of line David Laight <David.Laight@ACULAB.COM> - 2017-02-10 13:10 +0100

csiph-web