[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e675bba0-b14d-1448-172e-e3ed66c2c9ef@gmail.com>
Date: Mon, 29 Mar 2021 21:42:07 +0100
From: Dmitry Safonov <0x7f454c46@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>,
Dmitry Safonov <dima@...sta.com>,
syzbot <syzbot+834ffd1afc7212eb8147@...kaller.appspotmail.com>,
davem@...emloft.net, herbert@...dor.apana.org.au, kuba@...nel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
steffen.klassert@...unet.com, syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] WARNING in xfrm_alloc_compat (2)
On 3/29/21 9:31 PM, Eric Dumazet wrote:
>
>
> On 3/29/21 9:57 PM, Dmitry Safonov wrote:
[..]
>>> ------------[ cut here ]------------
>>> unsupported nla_type 356
>>
>> This doesn't seem to be an issue.
>> Userspace sent message with nla_type 356, which is > __XFRM_MSG_MAX, so
>> this warning is expected. I've added it so when a new XFRM_MSG_* will be
>> added, to make sure that there will be translations to such messages in
>> xfrm_compat.ko (if the translation needed).
>> This is WARN_ON_ONCE(), so it can't be used as DOS.
>>
>> Ping me if you'd expect something else than once-a-boot warning for
>> this. Not sure how-to close syzkaller bug, docs have only `invalid' tag,
>> which isn't `not-a-bug'/`expected' tag:
>> https://github.com/google/syzkaller/blob/master/docs/syzbot.md
>>
>
> You should not use WARN_ON_ONCE() for this case (if user space can trigger it)
>
> https://lwn.net/Articles/769365/
>
> <quote>
> Greg Kroah-Hartman raised the problem of core kernel API code that will use WARN_ON_ONCE() to complain about bad usage; that will not generate the desired result if WARN_ON_ONCE() is configured to crash the machine. He was told that the code should just call pr_warn() instead, and that the called function should return an error in such situations. It was generally agreed that any WARN_ON() or WARN_ON_ONCE() calls that can be triggered from user space need to be fixed.
> </quote>
Yeah, fair enough, I've already thought after sending the reply that
WARN_ON*() prints registers and that may be unwanted.
I'll cook a patch to convert this and other WARNs in the module.
I wish there was something like pr_warn_backtrace_once(), but I guess
it's fine without dumpstack(), after all.
Thanks,
Dmitry
Powered by blists - more mailing lists