/[linux-patches]/genpatches-2.6/trunk/2.6.14/1146_4_netlink-fib_lookup.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1146_4_netlink-fib_lookup.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 292 - (show annotations) (download) (as text)
Tue Jan 31 21:50:53 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 1430 byte(s)
Large update - thanks goes to Kerin Millar for the legwork.
1 From stable-bounces@linux.kernel.org Thu Dec 1 14:08:28 2005
2 Date: Thu, 1 Dec 2005 23:05:12 +0100
3 From: Thomas Graf <tgraf@suug.ch>
4 To: "David S. Miller" <davem@davemloft.net>
5 Message-ID: <20051201220512.GT20395@postel.suug.ch>
6 Cc: Robert Olsson <Robert.Olsson@data.slu.se>, stable@kernel.org, netdev@vger.kernel.org
7 Subject: NETLINK: Fix processing of fib_lookup netlink messages
8
9 The receive path for fib_lookup netlink messages is lacking sanity
10 checks for header and payload and is thus vulnerable to malformed
11 netlink messages causing illegal memory references.
12
13 Signed-off-by: Thomas Graf <tgraf@suug.ch>
14 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15
16 ---
17 net/ipv4/fib_frontend.c | 8 ++++++--
18 1 file changed, 6 insertions(+), 2 deletions(-)
19
20 --- linux-2.6.14.3.orig/net/ipv4/fib_frontend.c
21 +++ linux-2.6.14.3/net/ipv4/fib_frontend.c
22 @@ -545,12 +545,16 @@ static void nl_fib_input(struct sock *sk
23 struct sk_buff *skb = NULL;
24 struct nlmsghdr *nlh = NULL;
25 struct fib_result_nl *frn;
26 - int err;
27 u32 pid;
28 struct fib_table *tb;
29
30 - skb = skb_recv_datagram(sk, 0, 0, &err);
31 + skb = skb_dequeue(&sk->sk_receive_queue);
32 nlh = (struct nlmsghdr *)skb->data;
33 + if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
34 + nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
35 + kfree_skb(skb);
36 + return;
37 + }
38
39 frn = (struct fib_result_nl *) NLMSG_DATA(nlh);
40 tb = fib_get_table(frn->tb_id_in);

  ViewVC Help
Powered by ViewVC 1.1.20