Commit 707abb79 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [NETLINK]: Infinite recursion in netlink.
parents cbc31a47 1194ed0a
...@@ -776,6 +776,8 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb ) ...@@ -776,6 +776,8 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb )
.nl_u = { .ip4_u = { .daddr = frn->fl_addr, .nl_u = { .ip4_u = { .daddr = frn->fl_addr,
.tos = frn->fl_tos, .tos = frn->fl_tos,
.scope = frn->fl_scope } } }; .scope = frn->fl_scope } } };
frn->err = -ENOENT;
if (tb) { if (tb) {
local_bh_disable(); local_bh_disable();
...@@ -787,6 +789,7 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb ) ...@@ -787,6 +789,7 @@ static void nl_fib_lookup(struct fib_result_nl *frn, struct fib_table *tb )
frn->nh_sel = res.nh_sel; frn->nh_sel = res.nh_sel;
frn->type = res.type; frn->type = res.type;
frn->scope = res.scope; frn->scope = res.scope;
fib_res_put(&res);
} }
local_bh_enable(); local_bh_enable();
} }
...@@ -801,6 +804,9 @@ static void nl_fib_input(struct sock *sk, int len) ...@@ -801,6 +804,9 @@ static void nl_fib_input(struct sock *sk, int len)
struct fib_table *tb; struct fib_table *tb;
skb = skb_dequeue(&sk->sk_receive_queue); skb = skb_dequeue(&sk->sk_receive_queue);
if (skb == NULL)
return;
nlh = (struct nlmsghdr *)skb->data; nlh = (struct nlmsghdr *)skb->data;
if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len || if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) { nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
...@@ -813,7 +819,7 @@ static void nl_fib_input(struct sock *sk, int len) ...@@ -813,7 +819,7 @@ static void nl_fib_input(struct sock *sk, int len)
nl_fib_lookup(frn, tb); nl_fib_lookup(frn, tb);
pid = nlh->nlmsg_pid; /*pid of sending process */ pid = NETLINK_CB(skb).pid; /* pid of sending process */
NETLINK_CB(skb).pid = 0; /* from kernel */ NETLINK_CB(skb).pid = 0; /* from kernel */
NETLINK_CB(skb).dst_group = 0; /* unicast */ NETLINK_CB(skb).dst_group = 0; /* unicast */
netlink_unicast(sk, skb, pid, MSG_DONTWAIT); netlink_unicast(sk, skb, pid, MSG_DONTWAIT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment