[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAABZP2yznP5jD6Og=-ZxgAh23VpfM1BGX4OJsOb00KDeyV-jyA@mail.gmail.com>
Date: Wed, 13 Mar 2013 12:00:34 +0800
From: Zhouyi Zhou <zhouzhouyi@...il.com>
To: netdev@...r.kernel.org
Cc: stable@...r.kernel.org, trivial@...nel.org
Subject: [PATCH] net/core: fixing dst_neigh_lookup/dst_neigh_lookup_skb caused
kernel panic
when neighbour table is full, dst_neigh_lookup/dst_neigh_lookup_skb
will return -ENOBUFS which
is absolutely non zero, while all the code in kernel which use above
functions assume failure only
on zero return (I did a grep), which will cause kernel panic. (for
example: https://bugzilla.kernel.org/show_bug.cgi?id=54731)
This patch corrects above error with smallest changes to kernel source code.
Signed-off-by: Zhouyi Zhou <zhouzhouyi@...il.com>
diff --git a/include/net/dst.h b/include/net/dst.h
index 853cda1..d594f8b 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -413,13 +413,15 @@ static inline int dst_neigh_output(struct
dst_entry *dst, struct neighbour *n,
static inline struct neighbour *dst_neigh_lookup(const struct
dst_entry *dst, const void *daddr)
{
- return dst->ops->neigh_lookup(dst, NULL, daddr);
+ struct neighbour *n = dst->ops->neigh_lookup(dst, NULL, daddr);
+ return IS_ERR(n) ? NULL : n;
}
static inline struct neighbour *dst_neigh_lookup_skb(const struct
dst_entry *dst,
struct sk_buff *skb)
{
- return dst->ops->neigh_lookup(dst, skb, NULL);
+ struct neighbour *n = dst->ops->neigh_lookup(dst, skb, NULL);
+ return IS_ERR(n) ? NULL : n;
}
static inline void dst_link_failure(struct sk_buff *skb)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists