[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 11 Nov 2021 09:56:35 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Johannes Berg <johannes@...solutions.net>
Cc: syzbot <syzbot+5434727aa485c3203fed@...kaller.appspotmail.com>,
"andrii@...nel.org" <andrii@...nel.org>,
"ast@...nel.org" <ast@...nel.org>,
"avagin@...il.com" <avagin@...il.com>,
"bpf@...r.kernel.org" <bpf@...r.kernel.org>,
"cong.wang@...edance.com" <cong.wang@...edance.com>,
"daniel@...earbox.net" <daniel@...earbox.net>,
"davem@...emloft.net" <davem@...emloft.net>,
"hawk@...nel.org" <hawk@...nel.org>,
"john.fastabend@...il.com" <john.fastabend@...il.com>,
"kafai@...com" <kafai@...com>,
"kpsingh@...nel.org" <kpsingh@...nel.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"songliubraving@...com" <songliubraving@...com>,
"syzkaller-bugs@...glegroups.com" <syzkaller-bugs@...glegroups.com>,
"yhs@...com" <yhs@...com>
Subject: Re: [syzbot] WARNING in __dev_change_net_namespace
On Thu, Nov 11, 2021 at 08:50:33AM +0100, Johannes Berg wrote:
> On Thu, 2021-11-11 at 06:43 +0000, syzbot wrote:
> >
> > console output: https://syzkaller.appspot.com/x/log.txt?x=15b45fb6b00000
>
> So we see that fault injection is triggering a memory allocation failure
> deep within the device_rename():
>
> int __dev_change_net_namespace(struct net_device *dev, struct net *net,
> const char *pat, int new_ifindex)
> {
> ...
> /* Fixup kobjects */
> err = device_rename(&dev->dev, dev->name);
> WARN_ON(err);
>
>
> So we hit that WARN_ON().
>
> I'm not really sure what to do about that though. Feels like we should
> be able to cope with failures here, but clearly we don't, and it seems
> like it would also be tricky to do after all the work already done at
> this point.
>
> Perhaps device_rename() could grow an API to preallocate all the
> memories, but that would also be fairly involved, I imagine?
That would be a mess to unwind at times. For fault-injection stuff like
this, that can not be hit in "real world operation", if the issue can
not be easily handled, I don't think it is worth worrying about.
We have some things like this in the tty layer at boot time, if a memory
failure happens then, we have bigger overall problems in the system than
trying to recover from minor stuff like this.
thanks,
greg k-h
Powered by blists - more mailing lists