mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Rondreis <linhaoguo86@gmail.com>
Cc: pabeni@redhat.com, huangguangbin2@huawei.com,
	john.fastabend@gmail.com, hawk@kernel.org, trix@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: general protection fault in ethtool_get_drvinfo
Date: Thu, 15 Sep 2022 22:02:41 +0200	[thread overview]
Message-ID: <YyOE4VPJAnnTODJ4@lunn.ch> (raw)
In-Reply-To: <CAB7eexJUFDKsgE9g_2vp9ZM=A-JHwTMFBDqP2LC54WZ666pdZw@mail.gmail.com>

On Fri, Sep 16, 2022 at 12:02:22AM +0800, Rondreis wrote:
> Hello,
> 
> When fuzzing the Linux kernel driver v6.0-rc4, the following crash was
> triggered.
> 
> HEAD commit: 7e18e42e4b280c85b76967a9106a13ca61c16179
> git tree: upstream
> 
> kernel config: https://pastebin.com/raw/xtrgsXP3
> C reproducer: https://pastebin.com/raw/RtX3naYU
> console output: https://pastebin.com/raw/HqjSMu2n
> 
> Basically, in the c reproducer, we use the gadget module to emulate
> attaching a USB device(vendor id: 0x1b3d, product id: 0x19c, with the
> midi function) and executing some simple sequence of system calls.
> To reproduce this crash, we utilize a third-party library to emulate
> the attaching process: https://github.com/linux-usb-gadgets/libusbgx.
> Just clone this repository, install it, and compile the c
> reproducer with ``` gcc crash.c -lusbgx -lconfig -o crash ``` will do
> the trick.
> 
> I would appreciate it if you have any idea how to solve this bug.
> 
> The crash report is as follows:
> general protection fault, probably for non-canonical address
> 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN
> KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007]
> CPU: 1 PID: 6495 Comm: systemd-udevd Not tainted 6.0.0-rc4+ #20
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
> 1.13.0-1ubuntu1.1 04/01/2014
> RIP: 0010:ethtool_get_drvinfo+0x533/0x7d0 net/ethtool/ioctl.c:723

If this can be trusted:

723:		strlcpy(rsp->info.driver, dev->dev.parent->driver->name,
724:			sizeof(rsp->info.driver));

So it looks like dev->dev.parent->driver->name is invalid. That i
would say is a driver bug, a driver should always have a name.

What driver is dev->dev.parent->driver?

     Andrew

      reply	other threads:[~2022-09-15 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 16:02 Rondreis
2022-09-15 20:02 ` Andrew Lunn [this message]

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=YyOE4VPJAnnTODJ4@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=hawk@kernel.org \
    --cc=huangguangbin2@huawei.com \
    --cc=john.fastabend@gmail.com \
    --cc=linhaoguo86@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=trix@redhat.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

all inboxes | Powered by JetHome®