diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-05 10:35:26 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-05-05 10:35:26 -0700 |
commit | 24d0c2542b38963ae4d5171ecc0a2c1326c656bc (patch) | |
tree | 1d7de3d2f79f65c34e8f29d7bb6fe5ed512b226c | |
parent | 802d0db827eaa5a34dd655623c71134ec63d8c3f (diff) | |
parent | 7ee2b9e56495c56dcaffa2bab19b39451d9fdc8a (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull single_open() leak fixes from Al Viro:
"A bunch of fixes for a moderately common class of bugs: file with
single_open() done by its ->open() and seq_release as its ->release().
That leaks; fortunately, it's not _too_ common (either people manage
to RTFM that says "When using single_open(), the programmer should use
single_release() instead of seq_release() in the file_operations
structure to avoid a memory leak", or they just copy a correct
instance), but grepping through the tree has caught quite a pile.
All of that is, AFAICS, -stable fodder, for as far as the patches
apply. I tried to carve it up into reasonably-sized pieces (more or
less "comes from the same tree")"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
rcutrace: single_open() leaks
gadget: single_open() leaks
staging: single_open() leaks
megaraid: single_open() leak
wireless: single_open() leaks
input: single_open() leak
rtc: single_open() leaks
ds1620: single_open() leak
sh: single_open() leaks
parisc: single_open() leaks
mips: single_open() leaks
ia64: single_open() leaks
h8300: single_open() leaks
cris: single_open() leaks
arm: single_open() leaks
33 files changed, 41 insertions, 41 deletions
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c index 087fc321e9e5..b1b89882b113 100644 --- a/arch/arm/kernel/swp_emulate.c +++ b/arch/arm/kernel/swp_emulate.c @@ -99,7 +99,7 @@ static const struct file_operations proc_status_fops = { .open = proc_status_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index dd712f109738..358b82cb9f78 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -557,7 +557,7 @@ static const struct file_operations omap_pm_debug_fops = { .open = omap_pm_debug_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static void omap_pm_init_debugfs(void) diff --git a/arch/cris/arch-v10/kernel/fasttimer.c b/arch/cris/arch-v10/kernel/fasttimer.c index ce6f512968a4..48a59afbeeb1 100644 --- a/arch/cris/arch-v10/kernel/fasttimer.c +++ b/arch/cris/arch-v10/kernel/fasttimer.c @@ -644,7 +644,7 @@ static const struct file_operations proc_fasttimer_fops = { .open = proc_fasttimer_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* PROC_FS */ diff --git a/arch/cris/arch-v32/kernel/fasttimer.c b/arch/cris/arch-v32/kernel/fasttimer.c index e43dd70acd96..f6644535b17e 100644 --- a/arch/cris/arch-v32/kernel/fasttimer.c +++ b/arch/cris/arch-v32/kernel/fasttimer.c @@ -616,7 +616,7 @@ static const struct file_operations proc_fasttimer_fops = { .open = proc_fasttimer_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* PROC_FS */ diff --git a/arch/h8300/kernel/gpio.c b/arch/h8300/kernel/gpio.c index b02c752cd326..084bfd0c107e 100644 --- a/arch/h8300/kernel/gpio.c +++ b/arch/h8300/kernel/gpio.c @@ -161,7 +161,7 @@ static const struct file_operations gpio_proc_fops = { .open = gpio_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static __init int register_proc(void) diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index b17129e3b7c8..2b3c2d79256f 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c @@ -929,7 +929,7 @@ static const struct file_operations proc_palinfo_fops = { .open = proc_palinfo_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static void __cpuinit diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index 5035245cb258..4bc580af67b3 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c @@ -694,7 +694,7 @@ static const struct file_operations proc_salinfo_fops = { .open = proc_salinfo_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; module_init(salinfo_init); diff --git a/arch/ia64/sn/kernel/sn2/prominfo_proc.c b/arch/ia64/sn/kernel/sn2/prominfo_proc.c index daa8d6badb16..ec4de2b09653 100644 --- a/arch/ia64/sn/kernel/sn2/prominfo_proc.c +++ b/arch/ia64/sn/kernel/sn2/prominfo_proc.c @@ -149,7 +149,7 @@ static const struct file_operations proc_fit_fops = { .open = proc_fit_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int proc_version_show(struct seq_file *m, void *v) @@ -183,7 +183,7 @@ static const struct file_operations proc_version_fops = { .open = proc_version_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /* module entry points */ diff --git a/arch/mips/kernel/smtc-proc.c b/arch/mips/kernel/smtc-proc.c index 9fb714450e95..c10aa84c9fa9 100644 --- a/arch/mips/kernel/smtc-proc.c +++ b/arch/mips/kernel/smtc-proc.c @@ -61,7 +61,7 @@ static const struct file_operations smtc_proc_fops = { .open = smtc_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; void init_smtc_stats(void) diff --git a/arch/mips/pci/ops-pmcmsp.c b/arch/mips/pci/ops-pmcmsp.c index 4eaab6327369..3d27800edba2 100644 --- a/arch/mips/pci/ops-pmcmsp.c +++ b/arch/mips/pci/ops-pmcmsp.c @@ -92,7 +92,7 @@ static const struct file_operations msp_pci_rd_cnt_fops = { .open = msp_pci_rd_cnt_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /***************************************************************************** @@ -169,7 +169,7 @@ static const struct file_operations gen_pci_cfg_wr_fops = { .open = gen_pci_cfg_wr_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /***************************************************************************** diff --git a/arch/mips/sibyte/sb1250/bus_watcher.c b/arch/mips/sibyte/sb1250/bus_watcher.c index cb1e3cb37d70..8871e3345bff 100644 --- a/arch/mips/sibyte/sb1250/bus_watcher.c +++ b/arch/mips/sibyte/sb1250/bus_watcher.c @@ -145,7 +145,7 @@ static const struct file_operations bw_proc_fops = { .open = bw_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static void create_proc_decoder(struct bw_stats_struct *stats) diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c index 8fa314fbfb18..3e04242de5a7 100644 --- a/arch/parisc/kernel/pdc_chassis.c +++ b/arch/parisc/kernel/pdc_chassis.c @@ -275,7 +275,7 @@ static const struct file_operations pdc_chassis_warn_fops = { .open = pdc_chassis_warn_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int __init pdc_chassis_create_procfs(void) diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c index 851e5106e580..c0eec08d8f95 100644 --- a/arch/sh/drivers/dma/dma-api.c +++ b/arch/sh/drivers/dma/dma-api.c @@ -348,7 +348,7 @@ static const struct file_operations dma_proc_fops = { .open = dma_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; int register_dmac(struct dma_info *info) diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index 544b4ce617f8..0fae5296e311 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c @@ -355,7 +355,7 @@ static const struct file_operations ds1620_proc_therm_fops = { .open = ds1620_proc_therm_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif diff --git a/drivers/char/efirtc.c b/drivers/char/efirtc.c index ea54a6e3f5ad..e39e7402e623 100644 --- a/drivers/char/efirtc.c +++ b/drivers/char/efirtc.c @@ -369,7 +369,7 @@ static const struct file_operations efi_rtc_proc_fops = { .open = efi_rtc_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int __init diff --git a/drivers/char/genrtc.c b/drivers/char/genrtc.c index bc9b84d56ee4..4f943759d376 100644 --- a/drivers/char/genrtc.c +++ b/drivers/char/genrtc.c @@ -465,7 +465,7 @@ static const struct file_operations gen_rtc_proc_fops = { .open = gen_rtc_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int __init gen_rtc_proc_init(void) diff --git a/drivers/input/misc/hp_sdc_rtc.c b/drivers/input/misc/hp_sdc_rtc.c index 770479df8657..86b822806e95 100644 --- a/drivers/input/misc/hp_sdc_rtc.c +++ b/drivers/input/misc/hp_sdc_rtc.c @@ -515,7 +515,7 @@ static const struct file_operations hp_sdc_rtc_proc_fops = { .open = hp_sdc_rtc_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int hp_sdc_rtc_ioctl(struct file *file, diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 23a3498f14d4..830bb1d1f957 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c @@ -1502,7 +1502,7 @@ static const struct file_operations atmel_proc_fops = { .open = atmel_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static const struct net_device_ops atmel_netdev_ops = { diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 19c45e363aa7..d6033a8e5dea 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c @@ -89,7 +89,7 @@ static const struct file_operations ap_debug_proc_fops = { .open = ap_debug_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* PRISM2_NO_PROCFS_DEBUG */ @@ -1116,7 +1116,7 @@ static const struct file_operations prism2_sta_proc_fops = { .open = prism2_sta_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static void handle_add_proc_queue(struct work_struct *work) diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index 507ab99eef4e..6307a4e36c85 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c @@ -2957,7 +2957,7 @@ static const struct file_operations prism2_registers_proc_fops = { .open = prism2_registers_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* PRISM2_NO_PROCFS_DEBUG */ diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c index 7491dab2c105..aa7ad3a7a69b 100644 --- a/drivers/net/wireless/hostap/hostap_proc.c +++ b/drivers/net/wireless/hostap/hostap_proc.c @@ -52,7 +52,7 @@ static const struct file_operations prism2_debug_proc_fops = { .open = prism2_debug_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* PRISM2_NO_PROCFS_DEBUG */ @@ -103,7 +103,7 @@ static const struct file_operations prism2_stats_proc_fops = { .open = prism2_stats_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; @@ -265,7 +265,7 @@ static const struct file_operations prism2_crypt_proc_fops = { .open = prism2_crypt_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 7373255aa1e8..846f475f62c1 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -2770,7 +2770,7 @@ static const struct file_operations mega_proc_fops = { .open = mega_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /* diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c index db790f9fc9db..886c202de9ab 100644 --- a/drivers/staging/comedi/proc.c +++ b/drivers/staging/comedi/proc.c @@ -86,7 +86,7 @@ static const struct file_operations comedi_proc_fops = { .open = comedi_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; void comedi_proc_init(void) diff --git a/drivers/staging/csr/io.c b/drivers/staging/csr/io.c index f9b5c22c00b8..fe4a7ba2acc9 100644 --- a/drivers/staging/csr/io.c +++ b/drivers/staging/csr/io.c @@ -95,7 +95,7 @@ static const struct file_operations uf_proc_fops = { .open = uf_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* CONFIG_PROC_FS */ diff --git a/drivers/staging/cxt1e1/sbeproc.c b/drivers/staging/cxt1e1/sbeproc.c index 49f10f0b7d29..9361dd8ce125 100644 --- a/drivers/staging/cxt1e1/sbeproc.c +++ b/drivers/staging/cxt1e1/sbeproc.c @@ -189,7 +189,7 @@ static const struct file_operations sbecom_proc_fops = { .open = sbecom_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /* diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c index 21b369e0150f..94e426e4d98b 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_proc.c @@ -158,7 +158,7 @@ static const struct file_operations ft1000_proc_fops = { .open = ft1000_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int ft1000NotifyProc(struct notifier_block *this, unsigned long event, diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c index d8294d6c9560..eca6f0292b4b 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_proc.c @@ -160,7 +160,7 @@ static const struct file_operations ft1000_proc_fops = { .open = ft1000_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; static int diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index f7c1d9905ec6..ca691550436a 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -306,7 +306,7 @@ static const struct file_operations rtl8180_proc_fops = { .open = rtl8180_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /* diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 145923397556..71f5cde9ed1c 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -647,7 +647,7 @@ static const struct file_operations rtl8192_proc_fops = { .open = rtl8192_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; /* diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c index c4264e8c877d..f28f15baea96 100644 --- a/drivers/staging/wlags49_h2/wl_main.c +++ b/drivers/staging/wlags49_h2/wl_main.c @@ -160,7 +160,7 @@ static const struct file_operations scull_read_procmem_fops = { .open = scull_read_procmem_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* SCULL_USE_PROC */ diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 2d8c1cfea699..a766a4ca1cb7 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c @@ -2211,7 +2211,7 @@ static const struct file_operations fsl_proc_fops = { .open = fsl_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #define create_proc_file() proc_create(proc_filename, 0, NULL, &fsl_proc_fops) diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 480eeb7cfd92..52dd6cc6c0aa 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c @@ -1214,7 +1214,7 @@ static const struct file_operations udc_proc_fops = { .open = udc_proc_open, .read = seq_read, .llseek = seq_lseek, - .release = seq_release, + .release = single_release, }; #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ diff --git a/kernel/rcutree_trace.c b/kernel/rcutree_trace.c index 49099e81c87b..cf6c17412932 100644 --- a/kernel/rcutree_trace.c +++ b/kernel/rcutree_trace.c @@ -95,7 +95,7 @@ static const struct file_operations rcubarrier_fops = { .open = rcubarrier_open, .read = seq_read, .llseek = no_llseek, - .release = seq_release, + .release = single_release, }; #ifdef CONFIG_RCU_BOOST @@ -206,7 +206,7 @@ static const struct file_operations rcuexp_fops = { .open = rcuexp_open, .read = seq_read, .llseek = no_llseek, - .release = seq_release, + .release = single_release, }; #ifdef CONFIG_RCU_BOOST @@ -306,7 +306,7 @@ static const struct file_operations rcuhier_fops = { .open = rcuhier_open, .read = seq_read, .llseek = no_llseek, - .release = seq_release, + .release = single_release, }; static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp) @@ -348,7 +348,7 @@ static const struct file_operations rcugp_fops = { .open = rcugp_open, .read = seq_read, .llseek = no_llseek, - .release = seq_release, + .release = single_release, }; static void print_one_rcu_pending(struct seq_file *m, struct rcu_data *rdp) |