提交 c5098ebb 编写于 作者: T Thomas Graf 提交者: David S. Miller

ila: Fix tailroom allocation of lwtstate

Tailroom is supposed to be of length sizeof(struct ila_lwt) but
sizeof(struct ila_params) is currently allocated.

This leads to the dst_cache and connected member of ila_lwt being
referenced out of bounds.

struct ila_lwt {
	struct ila_params p;
	struct dst_cache dst_cache;
	u32 connected : 1;
};

Fixes: 65d7ab8d ("net: Identifier Locator Addressing module")
Signed-off-by: NThomas Graf <tgraf@suug.ch>
Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 7b1536ef
...@@ -122,7 +122,7 @@ static int ila_build_state(struct net_device *dev, struct nlattr *nla, ...@@ -122,7 +122,7 @@ static int ila_build_state(struct net_device *dev, struct nlattr *nla,
struct ila_lwt *ilwt; struct ila_lwt *ilwt;
struct ila_params *p; struct ila_params *p;
struct nlattr *tb[ILA_ATTR_MAX + 1]; struct nlattr *tb[ILA_ATTR_MAX + 1];
size_t encap_len = sizeof(*p); size_t encap_len = sizeof(*ilwt);
struct lwtunnel_state *newts; struct lwtunnel_state *newts;
const struct fib6_config *cfg6 = cfg; const struct fib6_config *cfg6 = cfg;
struct ila_addr *iaddr; struct ila_addr *iaddr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册