[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <31867b3d-341c-6ed5-c212-bfde37a1059d@cisco.com>
Date: Thu, 13 Aug 2020 12:25:22 +0000
From: "Hans-Christian Egtvedt (hegtvedt)" <hegtvedt@...co.com>
To: "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: ethtool 5.8 segfaults when changing settings on a device
Hello,
I am testing ethtool 5.8, and I noticed it segfaulted with the command
ethtool -s eth0 autoneg on
Backtrace as follows:
(gdb) run -s eth0 autoneg on
Starting program: /tmp/ethtool-5.8 -s eth0 autoneg on
Program received signal SIGSEGV, Segmentation fault.
0x0040bef8 in do_sset ()
(gdb) bt
#0 0x0040bef8 in do_sset ()
#1 0x00407d9c in do_ioctl_glinksettings ()
#2 0x00000000 in ?? ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I then tested reverting
https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/ethtool.c?id=bef780467fa7aa95dca3ed5cc3ebb8bec5882f08
And the command now passes.
I am running ethtool on top of Linux 4.4.232, hence there is no support
for ETHTOOL_xLINKSETTINGS.
Is the bef780467fa7aa95dca3ed5cc3ebb8bec5882f08 patch not correct, one
should check link_usettings pointer for non-NULL before memset'ing?
Since do_ioctl_glinksettings() will return NULL upon failure, which
matches well with kernels not supporting ETHTOOL_GLINKSETTINGS ioctl.
--
Best regards, Hans-Christian Noren Egtvedt
Powered by blists - more mailing lists