diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-10-09 17:48:16 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-21 09:17:11 -0700 |
commit | dd81262194af3606f714c8b39c8eb35da8c78f00 (patch) | |
tree | 27449b1b8c20f643e51fd2b485f5378c7c9251dc /firmware | |
parent | a6a1e89eda1562696a35465a3663b6fcf6ec48da (diff) | |
download | kernel_samsung_crespo-dd81262194af3606f714c8b39c8eb35da8c78f00.zip kernel_samsung_crespo-dd81262194af3606f714c8b39c8eb35da8c78f00.tar.gz kernel_samsung_crespo-dd81262194af3606f714c8b39c8eb35da8c78f00.tar.bz2 |
pktgen: fix crash when generating IPv6 packets
commit 5aa8b572007c4bca1e6d3dd4c4820f1ae49d6bb2 upstream.
For IPv6, sizeof(struct ipv6hdr) = 40, thus the following
expression will result negative:
datalen = pkt_dev->cur_pkt_size - 14 -
sizeof(struct ipv6hdr) - sizeof(struct udphdr) -
pkt_dev->pkt_overhead;
And, the check "if (datalen < sizeof(struct pktgen_hdr))" will be
passed as "datalen" is promoted to unsigned, therefore will cause
a crash later.
This is a quick fix by checking if "datalen" is negative. The following
patch will increase the default value of 'min_pkt_size' for IPv6.
This bug should exist for a long time, so Cc -stable too.
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions