From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: alan@linux.intel.com, linux-kernel@vger.kernel.org, jirislaby@gmail.com
Subject: [PATCH 0/9] TTY: memory leaks patchset
Date: Thu, 15 Nov 2012 09:49:47 +0100 [thread overview]
Message-ID: <1352969396-23760-1-git-send-email-jslaby@suse.cz> (raw)
I introduced severe memory leaks by (still -next) commit "TTY: move
tty buffers to tty_port", especially in the pty driver. I did not
realize that tty_port is not destroyed as I had imagined. Most of the
drivers simply do not use the tty_port-reference-counted model.
In this series, some are converted to reference counting -- those
which already do reference counting with their own kref. The rest is
just forced to call a newly added function which properly destroys the
tty_port.
Plus there is one patch to fix isicom accessing unsafe tty pointer.
This series should go upstream regardless "TTY: move tty buffers to
tty_port" if we decide to revert that commit due to the reported
warnings I cannot reproduce and neither catch the root cause. At least
while trying to reproduce those I found the leaks fixed here.
Jiri Slaby (9):
TTY: isicom, stop using port->tty
TTY: pty, fix tty buffers leak
ISDN: capi, use kref from tty_port
MMC: sdio_uart, remove unused member from sdio_uart_port
MMC: sdio, use kref from tty_port
TTY: n_gsm, use kref from tty_port
TTY: introduce tty_port_destroy
TTY: isicom, fix tty buffers memory leak
TTY: call tty_port_destroy in the rest of drivers
arch/alpha/kernel/srmcons.c | 5 ++++-
arch/ia64/hp/sim/simserial.c | 1 +
arch/m68k/emu/nfcon.c | 6 ++++--
arch/parisc/kernel/pdc_cons.c | 5 +++--
arch/um/drivers/line.c | 2 ++
arch/xtensa/platforms/iss/console.c | 1 +
drivers/char/pcmcia/synclink_cs.c | 5 ++++-
drivers/char/ttyprintk.c | 4 +++-
drivers/isdn/capi/capi.c | 34 ++++++++++++++++-----------------
drivers/isdn/gigaset/common.c | 10 ++++++----
drivers/isdn/i4l/isdn_tty.c | 4 ++++
drivers/misc/pti.c | 7 +++++--
drivers/mmc/card/sdio_uart.c | 24 +++++++++++------------
drivers/net/usb/hso.c | 5 +++--
drivers/s390/char/con3215.c | 1 +
drivers/s390/char/sclp_tty.c | 4 +++-
drivers/s390/char/sclp_vt220.c | 2 ++
drivers/s390/char/tty3270.c | 2 ++
drivers/staging/ccg/u_serial.c | 5 ++++-
drivers/staging/dgrp/dgrp_specproc.c | 2 ++
drivers/staging/dgrp/dgrp_tty.c | 4 +++-
drivers/staging/ipack/devices/ipoctal.c | 2 ++
drivers/tty/amiserial.c | 2 ++
drivers/tty/bfin_jtag_comm.c | 6 ++++--
drivers/tty/cyclades.c | 8 +++++---
drivers/tty/ehv_bytechan.c | 2 ++
drivers/tty/hvc/hvsi.c | 1 +
drivers/tty/ipwireless/tty.c | 1 +
drivers/tty/isicom.c | 23 ++++++++++++----------
drivers/tty/moxa.c | 4 ++++
drivers/tty/mxser.c | 25 ++++++++++++++++--------
drivers/tty/n_gsm.c | 11 +++++------
drivers/tty/nozomi.c | 13 +++++++++----
drivers/tty/pty.c | 2 +-
drivers/tty/rocket.c | 2 ++
drivers/tty/serial/68328serial.c | 2 ++
drivers/tty/serial/ifx6x60.c | 5 ++++-
drivers/tty/serial/kgdb_nmi.c | 2 ++
drivers/tty/serial/serial_core.c | 6 ++++++
drivers/tty/synclink.c | 1 +
drivers/tty/synclink_gt.c | 5 ++++-
drivers/tty/synclinkmp.c | 5 ++++-
drivers/tty/tty_port.c | 18 +++++++++++++++--
drivers/tty/vt/vt.c | 5 ++++-
drivers/usb/gadget/u_serial.c | 5 ++++-
drivers/usb/serial/usb-serial.c | 1 +
include/linux/tty.h | 1 +
net/irda/ircomm/ircomm_tty.c | 1 +
48 files changed, 202 insertions(+), 90 deletions(-)
--
1.8.0
next reply other threads:[~2012-11-15 8:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 8:49 Jiri Slaby [this message]
2012-11-15 8:49 ` [PATCH 1/9] TTY: isicom, stop using port->tty Jiri Slaby
2012-11-15 8:49 ` [PATCH 2/9] TTY: pty, fix tty buffers leak Jiri Slaby
2012-11-15 8:49 ` [PATCH 3/9] ISDN: capi, use kref from tty_port Jiri Slaby
2012-11-15 8:49 ` [PATCH 4/9] MMC: sdio_uart, remove unused member from sdio_uart_port Jiri Slaby
2012-11-15 8:49 ` [PATCH 5/9] MMC: sdio, use kref from tty_port Jiri Slaby
2012-11-15 8:49 ` [PATCH 6/9] TTY: n_gsm, " Jiri Slaby
2012-11-15 8:49 ` [PATCH 7/9] TTY: introduce tty_port_destroy Jiri Slaby
2012-11-15 8:49 ` [PATCH 8/9] TTY: isicom, fix tty buffers memory leak Jiri Slaby
2012-11-15 8:49 ` [PATCH 9/9] TTY: call tty_port_destroy in the rest of drivers Jiri Slaby
2012-11-18 13:39 ` Tilman Schmidt
2012-11-27 16:52 ` Peter Hurley
2012-11-27 17:04 ` Greg Kroah-Hartman
2012-11-27 17:23 ` Peter Hurley
2012-11-28 2:37 ` [PATCH -next 0/3] staging/fwserial: teardown cleanup Peter Hurley
2012-11-28 2:37 ` [PATCH -next 1/3] staging/fwserial: Destruct embedded tty_port on teardown Peter Hurley
2012-11-28 2:37 ` [PATCH -next 2/3] staging/fwserial: Use WARN_ONCE when port table is corrupted Peter Hurley
2012-11-28 2:37 ` [PATCH -next 3/3] staging/fwserial: Remove superfluous free Peter Hurley
2012-11-15 10:42 ` [PATCH 0/9] TTY: memory leaks patchset Alan Cox
2012-11-16 1:21 ` Greg KH
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=1352969396-23760-1-git-send-email-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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®