From: Johan Hovold <johan@kernel.org>
To: Andreas Kemnade <andreas@kemnade.info>
Cc: davem@davemloft.net, joe@perches.com, peter@hurleysoftware.com,
linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Discussions about the Letux Kernel
<letux-kernel@openphoenux.org>
Subject: Re: [PATCH] net: hso: fix module unloading
Date: Tue, 25 Apr 2017 12:04:59 +0200 [thread overview]
Message-ID: <20170425100459.GM2823@localhost> (raw)
In-Reply-To: <1493061519-15785-1-git-send-email-andreas@kemnade.info>
On Mon, Apr 24, 2017 at 09:18:39PM +0200, Andreas Kemnade wrote:
> keep tty driver until usb driver is unregistered
> rmmod hso
> produces traces like this without that:
Yeah, a blatant use-after-free.
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Johan Hovold <johan@kernel.org>
> ---
> drivers/net/usb/hso.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
> index 2e66340..b75e23f 100644
> --- a/drivers/net/usb/hso.c
> +++ b/drivers/net/usb/hso.c
> @@ -3293,9 +3293,9 @@ static void __exit hso_exit(void)
> pr_info("unloaded\n");
>
> tty_unregister_driver(tty_drv);
> - put_tty_driver(tty_drv);
> /* deregister the usb driver */
> usb_deregister(&hso_driver);
> + put_tty_driver(tty_drv);
> }
>
> /* Module definitions */
Thanks,
Johan
next prev parent reply other threads:[~2017-04-25 10:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 19:18 [PATCH] net: hso: fix module unloading Andreas Kemnade
2017-04-24 19:18 ` Andreas Kemnade
2017-04-25 10:04 ` Johan Hovold [this message]
2017-04-25 15:52 ` David Miller
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=20170425100459.GM2823@localhost \
--to=johan@kernel.org \
--cc=andreas@kemnade.info \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=letux-kernel@openphoenux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=peter@hurleysoftware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.