Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1295147
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] mkiss: Fix use after free in sixpack_close(). |
| Date | 2015-12-18 22:10 +0100 |
| Message-ID | <qHarL-2rz-13@gated-at.bofh.it> (permalink) |
| References | <qGNYe-4LR-11@gated-at.bofh.it> <qGOrg-4Wi-9@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Ralf Baechle <ralf@linux-mips.org> Date: Thu, 17 Dec 2015 22:35:31 +0100 > On Thu, Dec 17, 2015 at 04:05:49PM -0500, David Miller wrote: > >> Subject: [PATCH 2/2] mkiss: Fix use after free in sixpack_close(). > > Make that subject "... mkiss_close()." Durrr... indeed. Thanks for catching that. Committed as follows: ==================== [PATCH] mkiss: Fix use after free in mkiss_close(). Need to do the unregister_device() after all references to the driver private have been done. Signed-off-by: David S. Miller <davem@davemloft.net> --- drivers/net/hamradio/mkiss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c index 216bfd3..0b72b9d 100644 --- a/drivers/net/hamradio/mkiss.c +++ b/drivers/net/hamradio/mkiss.c @@ -798,13 +798,13 @@ static void mkiss_close(struct tty_struct *tty) if (!atomic_dec_and_test(&ax->refcnt)) down(&ax->dead_sem); - unregister_netdev(ax->dev); - /* Free all AX25 frame buffers. */ kfree(ax->rbuff); kfree(ax->xbuff); ax->tty = NULL; + + unregister_netdev(ax->dev); } /* Perform I/O control on an active ax25 channel. */ -- 2.4.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 2/2] mkiss: Fix use after free in sixpack_close(). David Miller <davem@davemloft.net> - 2015-12-17 22:10 +0100
Re: [PATCH 2/2] mkiss: Fix use after free in sixpack_close(). Ralf Baechle <ralf@linux-mips.org> - 2015-12-17 22:40 +0100
Re: [PATCH 2/2] mkiss: Fix use after free in sixpack_close(). David Miller <davem@davemloft.net> - 2015-12-18 22:10 +0100
csiph-web