kernel-ark/drivers/s390/cio
Christian Borntraeger 05d419b11f [S390] Fix memory leak in /proc/cio_ignore
There is a memory leak in /proc/cio_ignore. The iterator is allocated
in cio_ignore_proc_seq_start, but never freed in
cio_ignore_proc_seq_stop, because we cannot use the iterator
that was passed by seqfile. The seqfile interface passes the last
seen iterator to the stop function and not the first one. Since our
next function will return NULL at the end, the iter passed to
cio_ignore_proc_seq_stop is NULL. The original iter has leaked.
The solution is to use seq_open_private.

Found with kmemleak:
unreferenced object 0x1c720580 (size 32):
  comm "head", pid 973, jiffies 4294958302
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [<0000000000203154>] kmem_cache_alloc+0x190/0x19c
    [<00000000003fb462>] cio_ignore_proc_seq_start+0x5e/0x128
    [<0000000000231018>] seq_read+0xc8/0x4bc
    [<0000000000273954>] proc_reg_read+0xa8/0xf4
    [<000000000020e3d8>] vfs_read+0xac/0x1a4
    [<000000000020e5c6>] SyS_read+0x52/0xa8
    [<000000000011836e>] sysc_noemu+0x10/0x16
    [<0000004690b7936c>] 0x4690b7936c

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-10-06 10:35:07 +02:00
..
airq.c [S390] cio: airq - fix array boundary 2009-03-26 15:24:14 +01:00
blacklist.c [S390] Fix memory leak in /proc/cio_ignore 2009-10-06 10:35:07 +02:00
blacklist.h
ccwgroup.c [S390] pm: ccwgroup bus power management callbacks 2009-06-16 10:31:08 +02:00
chp.c [S390] cio: channel path memory leak 2009-10-06 10:35:06 +02:00
chp.h [S390] cio: Repair chpid event handling. 2008-07-14 10:02:11 +02:00
chsc_sch.c [S390] pm: chsc subchannel driver power management callbacks 2009-06-16 10:31:10 +02:00
chsc_sch.h [S390] cio: Add chsc subchannel driver. 2008-07-14 10:02:12 +02:00
chsc.c [S390] pm: css bus power management callbacks 2009-06-16 10:31:09 +02:00
chsc.h [S390] cio: move scsw helper functions to header file 2009-09-11 10:29:36 +02:00
cio_debug.h [S390] cio: Remove cio_msg kernel parameter. 2008-05-07 09:23:01 +02:00
cio.c [S390] cio: remove subchannel init_name 2009-09-11 10:29:40 +02:00
cio.h [S390] cio: remove ccw_device init_name 2009-09-11 10:29:41 +02:00
cmf.c [S390] pm: ccw bus power management callbacks 2009-06-16 10:31:08 +02:00
crw.c [S390] cio/crw: add/fix locking 2009-03-26 15:24:13 +01:00
css.c [S390] cio: introduce consistent subchannel scanning 2009-09-22 22:58:42 +02:00
css.h [S390] cio: idset use actual number of ssids 2009-09-22 22:58:42 +02:00
device_fsm.c [S390] cio: failing set online/offline processing. 2009-09-11 10:29:38 +02:00
device_id.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
device_ops.c [S390] pm: ccw bus power management callbacks 2009-06-16 10:31:08 +02:00
device_pgid.c [S390] cio: introduce cio_update_schib 2008-12-25 13:39:10 +01:00
device_status.c [S390] cio: introduce cio_update_schib 2008-12-25 13:39:10 +01:00
device.c [S390] cio: introduce css_settle 2009-09-22 22:58:41 +02:00
device.h [S390] cio: merge init calls 2009-09-22 22:58:41 +02:00
fcx.c [S390] cio: provide functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
idset.c [S390] cio: introduce consistent subchannel scanning 2009-09-22 22:58:42 +02:00
idset.h [S390] cio: introduce consistent subchannel scanning 2009-09-22 22:58:42 +02:00
io_sch.h [S390] pm: ccw bus power management callbacks 2009-06-16 10:31:08 +02:00
ioasm.h [S390] cio: inline assembly cleanup 2008-10-10 21:33:53 +02:00
isc.c [S390] cio: introduce isc_(un)register functions. 2008-07-14 10:02:11 +02:00
itcw.c [S390] cio: provide helper functions for fcx enabled I/O 2008-07-14 10:02:08 +02:00
Makefile [S390] cio: move scsw helper functions to header file 2009-09-11 10:29:36 +02:00
qdio_debug.c const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
qdio_debug.h [S390] qdio: rework debug feature logging 2008-12-25 13:38:59 +01:00
qdio_main.c [S390] qdio: change state of all primed input buffers 2009-09-22 22:58:43 +02:00
qdio_perf.c const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
qdio_perf.h [S390] qdio: inline qdio_perf_stat_inc 2009-06-12 10:27:32 +02:00
qdio_setup.c [S390] qdio: report SIGA errors directly 2009-03-26 15:24:22 +01:00
qdio_thinint.c [S390] qdio: merge AI tasklet into interrupt handler 2009-06-22 12:08:20 +02:00
qdio.h [S390] qdio: remove limited number of debugfs entries 2009-09-11 10:29:39 +02:00