]> git.baikalelectronics.ru Git - kernel.git/commit
netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages
authorDaniel Borkmann <dborkman@redhat.com>
Sun, 5 Jan 2014 23:57:54 +0000 (00:57 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 Jan 2014 16:40:02 +0000 (17:40 +0100)
commit9fbaa1a6eb2ace1516570bf3896f25a598b5f852
treef8ac8b9d95631e8434ed6e692e0119c8e4166bd6
parent9214305f94018ed6d462635271f9f63fb44977d1
netfilter: nf_conntrack_dccp: fix skb_header_pointer API usages

Some occurences in the netfilter tree use skb_header_pointer() in
the following way ...

  struct dccp_hdr _dh, *dh;
  ...
  skb_header_pointer(skb, dataoff, sizeof(_dh), &dh);

... where dh itself is a pointer that is being passed as the copy
buffer. Instead, we need to use &_dh as the forth argument so that
we're copying the data into an actual buffer that sits on the stack.

Currently, we probably could overwrite memory on the stack (e.g.
with a possibly mal-formed DCCP packet), but unintentionally, as
we only want the buffer to be placed into _dh variable.

Fixes: 823727847f2a ("[NETFILTER]: nf_conntrack: add DCCP protocol support")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
net/netfilter/nf_conntrack_proto_dccp.c