netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
To: Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Alexander Viro
	<viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
Cc: linux-rtc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Alessandro Zummo
	<a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org>,
	Alexandre Belloni
	<alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org>,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Greg Kroah-Hartman
	<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
	jfs-discussion-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-afs-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netfilter-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jiri Slaby <jslaby-IBi9RG/b67k@public.gmane.org>,
	linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Alexey Dobriyan
	<adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	megaraidlinux.pdl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org,
	drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org
Subject: [PATCH 01/42] net/can: single_open_net needs to be paired with single_release_net
Date: Wed, 16 May 2018 11:43:05 +0200	[thread overview]
Message-ID: <20180516094346.20506-2-hch@lst.de> (raw)
In-Reply-To: <20180516094346.20506-1-hch-jcswGhMUV9g@public.gmane.org>

Otherwise we will leak a reference to the network namespace.

Signed-off-by: Christoph Hellwig <hch-jcswGhMUV9g@public.gmane.org>
---
 net/can/bcm.c  | 2 +-
 net/can/proc.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/can/bcm.c b/net/can/bcm.c
index ac5e5e34fee3..8073fa14e143 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -249,7 +249,7 @@ static const struct file_operations bcm_proc_fops = {
 	.open		= bcm_proc_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= single_release,
+	.release	= single_release_net,
 };
 #endif /* CONFIG_PROC_FS */
 
diff --git a/net/can/proc.c b/net/can/proc.c
index fdf704e9bb8c..fde2fd55b826 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -279,7 +279,7 @@ static const struct file_operations can_stats_proc_fops = {
 	.open		= can_stats_proc_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= single_release,
+	.release	= single_release_net,
 };
 
 static int can_reset_stats_proc_show(struct seq_file *m, void *v)
@@ -449,7 +449,7 @@ static const struct file_operations can_rcvlist_sff_proc_fops = {
 	.open		= can_rcvlist_sff_proc_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= single_release,
+	.release	= single_release_net,
 };
 
 
@@ -492,7 +492,7 @@ static const struct file_operations can_rcvlist_eff_proc_fops = {
 	.open		= can_rcvlist_eff_proc_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
-	.release	= single_release,
+	.release	= single_release_net,
 };
 
 /*
-- 
2.17.0

  parent reply	other threads:[~2018-05-16  9:43 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  9:43 simplify procfs code for seq_file instances V3 Christoph Hellwig
     [not found] ` <20180516094346.20506-1-hch-jcswGhMUV9g@public.gmane.org>
2018-05-16  9:43   ` Christoph Hellwig [this message]
2018-05-16  9:43 ` [PATCH 02/42] proc: introduce a proc_pid_ns helper Christoph Hellwig
2018-05-16  9:43 ` [PATCH 03/42] proc: don't detour through seq->private to get the inode Christoph Hellwig
2018-05-16  9:43 ` [PATCH 04/42] proc: simplify proc_register calling conventions Christoph Hellwig
2018-05-16  9:43 ` [PATCH 05/42] proc: add a proc_create_reg helper Christoph Hellwig
2018-05-16  9:43 ` [PATCH 06/42] proc: introduce proc_create_seq{,_data} Christoph Hellwig
2018-05-16  9:43 ` [PATCH 07/42] proc: introduce proc_create_seq_private Christoph Hellwig
2018-05-16  9:43 ` [PATCH 08/42] proc: introduce proc_create_single{,_data} Christoph Hellwig
2018-05-16  9:43 ` [PATCH 09/42] ipv{4,6}/udp{,lite}: simplify proc registration Christoph Hellwig
2018-05-16  9:43 ` [PATCH 10/42] ipv{4,6}/tcp: simplify procfs registration Christoph Hellwig
2018-05-16  9:43 ` [PATCH 11/42] ipv{4,6}/ping: simplify proc file creation Christoph Hellwig
2018-05-16  9:43 ` [PATCH 12/42] ipv{4, 6}/raw: simplify ѕeq_file code Christoph Hellwig
2018-05-16  9:43 ` [PATCH 13/42] ipv6/flowlabel: simplify pid namespace lookup Christoph Hellwig
2018-05-16  9:43 ` [PATCH 14/42] net/kcm: simplify proc registration Christoph Hellwig
2018-05-16  9:43 ` [PATCH 15/42] netfilter/x_tables: simplify ѕeq_file code Christoph Hellwig
2018-05-16  9:43 ` [PATCH 16/42] net: move seq_file_single_net to <linux/seq_file_net.h> Christoph Hellwig
2018-05-16  9:43 ` [PATCH 17/42] proc: introduce proc_create_net{,_data} Christoph Hellwig
2018-05-16  9:43 ` [PATCH 18/42] proc: introduce proc_create_net_single Christoph Hellwig
2018-05-16  9:43 ` [PATCH 19/42] acpi/battery: simplify procfs code Christoph Hellwig
2018-05-16  9:43 ` [PATCH 20/42] sgi-gru: " Christoph Hellwig
2018-05-16  9:43 ` [PATCH 21/42] megaraid: " Christoph Hellwig
2018-05-16  9:43 ` [PATCH 22/42] sg: " Christoph Hellwig
2018-05-16  9:43 ` [PATCH 23/42] afs: " Christoph Hellwig
2018-05-16  9:43 ` [PATCH 24/42] ext4: " Christoph Hellwig
2018-05-16  9:43 ` [PATCH 25/42] jfs: " Christoph Hellwig
2018-05-16 13:15   ` [Jfs-discussion] " Dave Kleikamp
2018-05-16  9:43 ` [PATCH 26/42] staging/rtl8192u: " Christoph Hellwig
2018-05-16  9:43 ` [PATCH 27/42] resource: switch to proc_create_seq_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 28/42] drbd: switch to proc_create_single Christoph Hellwig
     [not found]   ` <20180516094346.20506-29-hch-jcswGhMUV9g@public.gmane.org>
2018-05-18 12:55     ` Lars Ellenberg
2018-05-16  9:43 ` [PATCH 29/42] rtc/proc: switch to proc_create_single_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 30/42] bonding: switch to proc_create_seq_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 31/42] hostap: switch to proc_create_{seq,single}_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 32/42] neigh: switch to proc_create_seq_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 33/42] netfilter/xt_hashlimit: switch to proc_create_{seq, single}_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 34/42] netfilter/x_tables: switch to proc_create_seq_private Christoph Hellwig
2018-05-16  9:43 ` [PATCH 35/42] bluetooth: switch to proc_create_seq_data Christoph Hellwig
2018-05-16  9:43 ` [PATCH 36/42] atm: simplify procfs code Christoph Hellwig
2018-05-16  9:43 ` [PATCH 37/42] atm: switch to proc_create_seq_private Christoph Hellwig
2018-05-16  9:43 ` [PATCH 38/42] isdn: replace ->proc_fops with ->proc_show Christoph Hellwig
2018-05-18  8:43   ` Paul Bolle
     [not found]     ` <4e7091873e8a220c454a7ce5a3f52edc5b5c3e3a.camel-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>
2018-05-18  8:58       ` Christoph Hellwig
2018-05-16  9:43 ` [PATCH 39/42] ide: remove ide_driver_proc_write Christoph Hellwig
2018-05-16  9:43 ` [PATCH 40/42] ide: replace ->proc_fops with ->proc_show Christoph Hellwig
2018-05-16  9:43 ` [PATCH 41/42] tty: " Christoph Hellwig
2018-05-16  9:58   ` Greg Kroah-Hartman
2018-05-16  9:43 ` [PATCH 42/42] proc: update SIZEOF_PDE_INLINE_NAME for the new pde fields Christoph Hellwig
2018-05-16 13:28 ` simplify procfs code for seq_file instances V3 Al Viro

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=20180516094346.20506-2-hch@lst.de \
    --to=hch-jcswghmuv9g@public.gmane.org \
    --cc=a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org \
    --cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=alexandre.belloni-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
    --cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
    --cc=drbd-dev-cunTk1MwBs8qoQakbn7OcQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jfs-discussion-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=jslaby-IBi9RG/b67k@public.gmane.org \
    --cc=linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-afs-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-ide-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rtc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=megaraidlinux.pdl-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netfilter-devel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn@public.gmane.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;
as well as URLs for NNTP newsgroup(s).