From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Edward AD <eadavis@sina.com>,
syzbot+85792f3143e6271d2c97@syzkaller.appspotmail.com,
linux-kernel@vger.kernel.org, rafael@kernel.org,
syzkaller-bugs@googlegroups.com
Subject: Re: [PATCH] kobject: fix kobj and fmt are both null
Date: Mon, 4 Sep 2023 12:44:56 +0300 [thread overview]
Message-ID: <ZPWnGAeMdmqWpTPw@smile.fi.intel.com> (raw)
In-Reply-To: <2023090328-slam-verbose-957d@gregkh>
On Sun, Sep 03, 2023 at 02:54:53PM +0200, Greg KH wrote:
> On Sun, Sep 03, 2023 at 08:42:31PM +0800, Edward AD wrote:
> > If kobj and fmt are both NULL, it will cause an exception in kvasprintf_const,
> > then when this situation occurs, -EINVAL is directly returned.
>
> How can this happen? Are there any in-kernel users that cause this to
> occur?
Theoretically anything which uses
dev_set_name(dev, dev_name(dev));
is affected, but practically it happens only when _previous_ dev_set_name()
fails, which _only_ may happen due to fault injection.
> If so, which ones, why not fix that?
In any case the real fix is here:
https://lore.kernel.org/all/20230828145824.3895288-1-andriy.shevchenko@linux.intel.com/
> And your description isn't quite correct here, you are not checking for
> kobj, but rather kobj->name.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-09-04 9:45 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-02 3:05 [syzbot] [kernel?] general protection fault in tty_register_device_attr syzbot
[not found] ` <20230903124231.3748101-1-eadavis@sina.com>
2023-09-03 12:54 ` [PATCH] kobject: fix kobj and fmt are both null Greg KH
2023-09-04 9:44 ` Andy Shevchenko [this message]
2023-09-03 21:59 ` [syzbot] [kernel?] general protection fault in tty_register_device_attr Thomas Weißschuh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZPWnGAeMdmqWpTPw@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=eadavis@sina.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=syzbot+85792f3143e6271d2c97@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox