]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: rds: use correct size for max unacked packets and bytes
authorSasha Levin <sasha.levin@oracle.com>
Tue, 3 Feb 2015 13:55:58 +0000 (08:55 -0500)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Wed, 8 Jul 2015 21:00:15 +0000 (14:00 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit db27ebb111e9f69efece08e4cb6a34ff980f8896)

Orabug: 20585918

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
net/rds/sysctl.c

index 4716649d8c2dbd34271100a848d12f05e24741e9..05cba38afb6f19a5bd1a65eca7b2387eccd1c432 100644 (file)
@@ -92,14 +92,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,
        },