[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200720001251.5nwf7nhcivl6b4yk@lion.mk-sys.cz>
Date: Mon, 20 Jul 2020 02:12:51 +0200
From: Michal Kubecek <mkubecek@...e.cz>
To: Andrew Lunn <andrew@...n.ch>
Cc: netdev <netdev@...r.kernel.org>, Chris Healy <cphealy@...il.com>
Subject: Re: [PATCH ethtool] Fix segfault with cable test and ./configure
--disable-netlink
On Fri, Jul 17, 2020 at 12:05:09AM +0200, Andrew Lunn wrote:
> When the netlink interface code is disabled, a stub version of
> netlink_run_handler() is used. This stub version needs to handle the
> case when there is no possibility for a command to fall back to the
> IOCTL call. The two cable tests commands have no such fallback, and if
> we don't handle this, ethtool tries to jump through a NULL pointer
> resulting in a segfault.
>
> Reported-by: Chris Healy <cphealy@...il.com>
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
Applied, thank you. I'll need to be more thorough with teseting the
--disable-netlink builds.
Michal
> ---
> netlink/extapi.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/netlink/extapi.h b/netlink/extapi.h
> index c5bfde9..a35d5f2 100644
> --- a/netlink/extapi.h
> +++ b/netlink/extapi.h
> @@ -46,6 +46,12 @@ void nl_monitor_usage(void);
> static inline void netlink_run_handler(struct cmd_context *ctx,
> nl_func_t nlfunc, bool no_fallback)
> {
> + if (no_fallback) {
> + fprintf(stderr,
> + "Command requires kernel netlink support which is not "
> + "enabled in this ethtool binary\n");
> + exit(1);
> + }
> }
>
> static inline int nl_monitor(struct cmd_context *ctx)
> --
> 2.27.0
>
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists