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
This commit is contained in:
Linus Torvalds 2013-05-05 10:35:26 -07:00
commit 24d0c2542b
33 changed files with 41 additions and 41 deletions

View File

@ -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

View File

@ -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)

View File

@ -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 */

View File

@ -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 */

View File

@ -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)

View File

@ -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

View File

@ -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);

View File

@ -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 */

View File

@ -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)

View File

@ -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,
};
/*****************************************************************************

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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,

View File

@ -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 = {

View File

@ -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)

View File

@ -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 */

View File

@ -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,
};

View File

@ -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,
};
/*

View File

@ -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)

View File

@ -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 */

View File

@ -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,
};
/*

View File

@ -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,

View File

@ -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

View File

@ -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,
};
/*

View File

@ -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,
};
/*

View File

@ -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 */

View File

@ -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)

View File

@ -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 */

View File

@ -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)