Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2755

kernel-2.6.18-238.el5.src.rpm

From: Neil Horman <nhorman@redhat.com>
Date: Thu, 9 Sep 2010 18:03:57 -0400
Subject: [net] ipv4: fix oops in writing to forwarding sysctl
Message-id: <20100909180357.GP10890@shamino.rdu.redhat.com>
Patchwork-id: 28194
O-Subject: [RHEL5.6 PATCH] ipv4: fix oops in writing to forwarding sysctl (bz
	629638)
Bugzilla: 629638
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
RH-Acked-by: David S. Miller <davem@redhat.com>
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>
RH-Acked-by: Thomas Graf <tgraf@redhat.com>

Hey-
	We recently found a regression in RHEL5 in which writing to
/proc/sys/net/conf/<ifc>/forwarding causes an oops.  It happens because the
sysctl handler for this knob expects the extra1 field of the ctl_table to point
to the ipv4_devconf structure now, and devinet_sysctl_register never sets that
up.  This patch corrects that by assigning the extra1 field properly.  Patch
provided by  Veaceslav Falico.

Brew Status:
https://brewweb.devel.redhat.com/taskinfo?taskID=2751994

Tested successfully by me on dell-pe1950-07

Resolves bz 629638

Neil

Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index ead41ab..cb40963 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1554,6 +1554,7 @@ static void devinet_sysctl_register(struct in_device *in_dev,
 			continue;
 
 		t->devinet_vars[i].data += (char *)p - (char *)&ipv4_devconf;
+		t->devinet_vars[i].extra1 = p;
 		t->devinet_vars[i].de = NULL;
 	}