* [PATCH] sctp: fix /proc/net/sctp/ memory leak
@ 2012-11-13 14:01 Tommi Rantala
2012-11-13 15:01 ` Neil Horman
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Tommi Rantala @ 2012-11-13 14:01 UTC (permalink / raw)
To: linux-sctp
We are using single_open_net() and seq_open_net() in the opener
functions, so avoid leaking memory by using single_release_net() and
seq_release_net() as the struct file_operations release functions.
Discovered with Trinity (the syscall fuzzer).
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
---
net/sctp/proc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index c3bea26..9966e7b 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -102,7 +102,7 @@ static const struct file_operations sctp_snmp_seq_fops = {
.open = sctp_snmp_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = single_release,
+ .release = single_release_net,
};
/* Set up the proc fs entry for 'snmp' object. */
@@ -251,7 +251,7 @@ static const struct file_operations sctp_eps_seq_fops = {
.open = sctp_eps_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
/* Set up the proc fs entry for 'eps' object. */
@@ -372,7 +372,7 @@ static const struct file_operations sctp_assocs_seq_fops = {
.open = sctp_assocs_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
/* Set up the proc fs entry for 'assocs' object. */
@@ -517,7 +517,7 @@ static const struct file_operations sctp_remaddr_seq_fops = {
.open = sctp_remaddr_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
int __net_init sctp_remaddr_proc_init(struct net *net)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] sctp: fix /proc/net/sctp/ memory leak
2012-11-13 14:01 [PATCH] sctp: fix /proc/net/sctp/ memory leak Tommi Rantala
@ 2012-11-13 15:01 ` Neil Horman
2012-11-14 23:56 ` David Miller
2012-11-15 8:23 ` Tommi Rantala
2 siblings, 0 replies; 7+ messages in thread
From: Neil Horman @ 2012-11-13 15:01 UTC (permalink / raw)
To: linux-sctp
On Tue, Nov 13, 2012 at 04:01:16PM +0200, Tommi Rantala wrote:
> We are using single_open_net() and seq_open_net() in the opener
> functions, so avoid leaking memory by using single_release_net() and
> seq_release_net() as the struct file_operations release functions.
>
> Discovered with Trinity (the syscall fuzzer).
>
> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> ---
> net/sctp/proc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index c3bea26..9966e7b 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -102,7 +102,7 @@ static const struct file_operations sctp_snmp_seq_fops = {
> .open = sctp_snmp_seq_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = single_release,
> + .release = single_release_net,
> };
>
> /* Set up the proc fs entry for 'snmp' object. */
> @@ -251,7 +251,7 @@ static const struct file_operations sctp_eps_seq_fops = {
> .open = sctp_eps_seq_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = seq_release,
> + .release = seq_release_net,
> };
>
> /* Set up the proc fs entry for 'eps' object. */
> @@ -372,7 +372,7 @@ static const struct file_operations sctp_assocs_seq_fops = {
> .open = sctp_assocs_seq_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = seq_release,
> + .release = seq_release_net,
> };
>
> /* Set up the proc fs entry for 'assocs' object. */
> @@ -517,7 +517,7 @@ static const struct file_operations sctp_remaddr_seq_fops = {
> .open = sctp_remaddr_seq_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = seq_release,
> + .release = seq_release_net,
> };
>
> int __net_init sctp_remaddr_proc_init(struct net *net)
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] sctp: fix /proc/net/sctp/ memory leak
2012-11-13 14:01 [PATCH] sctp: fix /proc/net/sctp/ memory leak Tommi Rantala
2012-11-13 15:01 ` Neil Horman
@ 2012-11-14 23:56 ` David Miller
2012-11-15 8:23 ` Tommi Rantala
2 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2012-11-14 23:56 UTC (permalink / raw)
To: linux-sctp
This won't get applied unless you submit it to properly netdev@vger.kernel.org
Don't forget to incorporate Neil Horman's ACK when you do that.
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] sctp: fix /proc/net/sctp/ memory leak
@ 2012-11-15 8:23 ` Tommi Rantala
0 siblings, 0 replies; 7+ messages in thread
From: Tommi Rantala @ 2012-11-15 8:23 UTC (permalink / raw)
To: netdev
Cc: Neil Horman, Vlad Yasevich, Sridhar Samudrala, David S. Miller,
linux-sctp, Dave Jones, Tommi Rantala
We are using single_open_net() and seq_open_net() in the opener
functions, so avoid leaking memory by using single_release_net() and
seq_release_net() as the struct file_operations release functions.
Discovered with Trinity (the syscall fuzzer).
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
---
net/sctp/proc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index c3bea26..9966e7b 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -102,7 +102,7 @@ static const struct file_operations sctp_snmp_seq_fops = {
.open = sctp_snmp_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = single_release,
+ .release = single_release_net,
};
/* Set up the proc fs entry for 'snmp' object. */
@@ -251,7 +251,7 @@ static const struct file_operations sctp_eps_seq_fops = {
.open = sctp_eps_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
/* Set up the proc fs entry for 'eps' object. */
@@ -372,7 +372,7 @@ static const struct file_operations sctp_assocs_seq_fops = {
.open = sctp_assocs_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
/* Set up the proc fs entry for 'assocs' object. */
@@ -517,7 +517,7 @@ static const struct file_operations sctp_remaddr_seq_fops = {
.open = sctp_remaddr_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
int __net_init sctp_remaddr_proc_init(struct net *net)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH] sctp: fix /proc/net/sctp/ memory leak
@ 2012-11-15 8:23 ` Tommi Rantala
0 siblings, 0 replies; 7+ messages in thread
From: Tommi Rantala @ 2012-11-15 8:23 UTC (permalink / raw)
To: netdev
Cc: Neil Horman, Vlad Yasevich, Sridhar Samudrala, David S. Miller,
linux-sctp, Dave Jones, Tommi Rantala
We are using single_open_net() and seq_open_net() in the opener
functions, so avoid leaking memory by using single_release_net() and
seq_release_net() as the struct file_operations release functions.
Discovered with Trinity (the syscall fuzzer).
Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
---
net/sctp/proc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index c3bea26..9966e7b 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -102,7 +102,7 @@ static const struct file_operations sctp_snmp_seq_fops = {
.open = sctp_snmp_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = single_release,
+ .release = single_release_net,
};
/* Set up the proc fs entry for 'snmp' object. */
@@ -251,7 +251,7 @@ static const struct file_operations sctp_eps_seq_fops = {
.open = sctp_eps_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
/* Set up the proc fs entry for 'eps' object. */
@@ -372,7 +372,7 @@ static const struct file_operations sctp_assocs_seq_fops = {
.open = sctp_assocs_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
/* Set up the proc fs entry for 'assocs' object. */
@@ -517,7 +517,7 @@ static const struct file_operations sctp_remaddr_seq_fops = {
.open = sctp_remaddr_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release,
+ .release = seq_release_net,
};
int __net_init sctp_remaddr_proc_init(struct net *net)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] sctp: fix /proc/net/sctp/ memory leak
2012-11-15 8:23 ` Tommi Rantala
@ 2012-11-15 13:13 ` Eric Dumazet
-1 siblings, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2012-11-15 13:13 UTC (permalink / raw)
To: Tommi Rantala
Cc: netdev, Neil Horman, Vlad Yasevich, Sridhar Samudrala,
David S. Miller, linux-sctp, Dave Jones
On Thu, 2012-11-15 at 10:23 +0200, Tommi Rantala wrote:
> We are using single_open_net() and seq_open_net() in the opener
> functions, so avoid leaking memory by using single_release_net() and
> seq_release_net() as the struct file_operations release functions.
>
> Discovered with Trinity (the syscall fuzzer).
>
> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> ---
> net/sctp/proc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index c3bea26..9966e7b 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -102,7 +102,7 @@ static const struct file_operations sctp_snmp_seq_fops = {
> .open = sctp_snmp_seq_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = single_release,
> + .release = single_release_net,
> };
>
It seems you forgot to do do some work to pinpoint which commit added
this bug. Please add this in the changelog to ease maintainer and stable
teams work, and CC the author of said commit so that he has a chance to
Ack your patch.
Thanks !
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] sctp: fix /proc/net/sctp/ memory leak
@ 2012-11-15 13:13 ` Eric Dumazet
0 siblings, 0 replies; 7+ messages in thread
From: Eric Dumazet @ 2012-11-15 13:13 UTC (permalink / raw)
To: Tommi Rantala
Cc: netdev, Neil Horman, Vlad Yasevich, Sridhar Samudrala,
David S. Miller, linux-sctp, Dave Jones
On Thu, 2012-11-15 at 10:23 +0200, Tommi Rantala wrote:
> We are using single_open_net() and seq_open_net() in the opener
> functions, so avoid leaking memory by using single_release_net() and
> seq_release_net() as the struct file_operations release functions.
>
> Discovered with Trinity (the syscall fuzzer).
>
> Signed-off-by: Tommi Rantala <tt.rantala@gmail.com>
> Acked-by: Neil Horman <nhorman@tuxdriver.com>
> ---
> net/sctp/proc.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/net/sctp/proc.c b/net/sctp/proc.c
> index c3bea26..9966e7b 100644
> --- a/net/sctp/proc.c
> +++ b/net/sctp/proc.c
> @@ -102,7 +102,7 @@ static const struct file_operations sctp_snmp_seq_fops = {
> .open = sctp_snmp_seq_open,
> .read = seq_read,
> .llseek = seq_lseek,
> - .release = single_release,
> + .release = single_release_net,
> };
>
It seems you forgot to do do some work to pinpoint which commit added
this bug. Please add this in the changelog to ease maintainer and stable
teams work, and CC the author of said commit so that he has a chance to
Ack your patch.
Thanks !
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-11-15 13:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-13 14:01 [PATCH] sctp: fix /proc/net/sctp/ memory leak Tommi Rantala
2012-11-13 15:01 ` Neil Horman
2012-11-14 23:56 ` David Miller
2012-11-15 8:23 ` Tommi Rantala
2012-11-15 8:23 ` Tommi Rantala
2012-11-15 13:13 ` Eric Dumazet
2012-11-15 13:13 ` Eric Dumazet
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.