提交 24d0c254 编写于 作者: L Linus Torvalds

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
......@@ -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
......
......@@ -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)
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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
......
......@@ -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);
......@@ -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 */
......
......@@ -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)
......
......@@ -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,
};
/*****************************************************************************
......
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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,
......
......@@ -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 = {
......
......@@ -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)
......
......@@ -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 */
......
......@@ -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,
};
......
......@@ -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,
};
/*
......
......@@ -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)
......
......@@ -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 */
......
......@@ -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,
};
/*
......
......@@ -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,
......
......@@ -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
......
......@@ -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,
};
/*
......
......@@ -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,
};
/*
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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 */
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册