netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: rds: use correct size for max unacked packets and bytes
@ 2015-02-03 13:55 Sasha Levin
  2015-02-05  0:08 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2015-02-03 13:55 UTC (permalink / raw)
  To: linux-kernel
  Cc: Sasha Levin, Chien Yen, David S. Miller,
	moderated list:RDS - RELIABLE DA...,
	open list:NETWORKING [GENERAL]

Max unacked packets/bytes is an int while sizeof(long) was used in the
sysctl table.

This means that when they were getting read we'd also leak kernel memory
to userspace along with the timeout values.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 net/rds/sysctl.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index c3b0cd4..c173f69 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -71,14 +71,14 @@ static struct ctl_table rds_sysctl_rds_table[] = {
 	{
 		.procname	= "max_unacked_packets",
 		.data		= &rds_sysctl_max_unacked_packets,
-		.maxlen         = sizeof(unsigned long),
+		.maxlen         = sizeof(int),
 		.mode           = 0644,
 		.proc_handler   = proc_dointvec,
 	},
 	{
 		.procname	= "max_unacked_bytes",
 		.data		= &rds_sysctl_max_unacked_bytes,
-		.maxlen         = sizeof(unsigned long),
+		.maxlen         = sizeof(int),
 		.mode           = 0644,
 		.proc_handler   = proc_dointvec,
 	},
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net: rds: use correct size for max unacked packets and bytes
  2015-02-03 13:55 [PATCH] net: rds: use correct size for max unacked packets and bytes Sasha Levin
@ 2015-02-05  0:08 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-02-05  0:08 UTC (permalink / raw)
  To: sasha.levin; +Cc: linux-kernel, chien.yen, rds-devel, netdev

From: Sasha Levin <sasha.levin@oracle.com>
Date: Tue,  3 Feb 2015 08:55:58 -0500

> Max unacked packets/bytes is an int while sizeof(long) was used in the
> sysctl table.
> 
> This means that when they were getting read we'd also leak kernel memory
> to userspace along with the timeout values.
> 
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-05  0:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-03 13:55 [PATCH] net: rds: use correct size for max unacked packets and bytes Sasha Levin
2015-02-05  0:08 ` David Miller

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