From: <gregkh@linuxfoundation.org>
To: davem@davemloft.net, gregkh@linuxfoundation.org, julia.lawall@lip6.fr
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "ipv6: Check ip6_find_1stfragopt() return value properly." has been added to the 4.4-stable tree
Date: Fri, 02 Jun 2017 11:39:10 +0900 [thread overview]
Message-ID: <1496371150192191@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
ipv6: Check ip6_find_1stfragopt() return value properly.
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
ipv6-check-ip6_find_1stfragopt-return-value-properly.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Fri Jun 2 09:29:55 JST 2017
From: "David S. Miller" <davem@davemloft.net>
Date: Wed, 17 May 2017 22:54:11 -0400
Subject: ipv6: Check ip6_find_1stfragopt() return value properly.
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit 7dd7eb9513bd02184d45f000ab69d78cb1fa1531 ]
Do not use unsigned variables to see if it returns a negative
error or not.
Fixes: 2423496af35d ("ipv6: Prevent overrun when parsing v6 header options")
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv6/ip6_offload.c | 9 ++++-----
net/ipv6/ip6_output.c | 7 +++----
net/ipv6/udp_offload.c | 8 +++++---
3 files changed, 12 insertions(+), 12 deletions(-)
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -62,7 +62,6 @@ static struct sk_buff *ipv6_gso_segment(
const struct net_offload *ops;
int proto;
struct frag_hdr *fptr;
- unsigned int unfrag_ip6hlen;
u8 *prevhdr;
int offset = 0;
bool encap, udpfrag;
@@ -121,10 +120,10 @@ static struct sk_buff *ipv6_gso_segment(
skb->network_header = (u8 *)ipv6h - skb->head;
if (udpfrag) {
- unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr);
- if (unfrag_ip6hlen < 0)
- return ERR_PTR(unfrag_ip6hlen);
- fptr = (struct frag_hdr *)((u8 *)ipv6h + unfrag_ip6hlen);
+ int err = ip6_find_1stfragopt(skb, &prevhdr);
+ if (err < 0)
+ return ERR_PTR(err);
+ fptr = (struct frag_hdr *)((u8 *)ipv6h + err);
fptr->frag_off = htons(offset);
if (skb->next)
fptr->frag_off |= htons(IP6_MF);
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -571,11 +571,10 @@ int ip6_fragment(struct net *net, struct
int ptr, offset = 0, err = 0;
u8 *prevhdr, nexthdr = 0;
- hlen = ip6_find_1stfragopt(skb, &prevhdr);
- if (hlen < 0) {
- err = hlen;
+ err = ip6_find_1stfragopt(skb, &prevhdr);
+ if (err < 0)
goto fail;
- }
+ hlen = err;
nexthdr = *prevhdr;
mtu = ip6_skb_dst_mtu(skb);
--- a/net/ipv6/udp_offload.c
+++ b/net/ipv6/udp_offload.c
@@ -29,6 +29,7 @@ static struct sk_buff *udp6_ufo_fragment
u8 frag_hdr_sz = sizeof(struct frag_hdr);
__wsum csum;
int tnl_hlen;
+ int err;
mss = skb_shinfo(skb)->gso_size;
if (unlikely(skb->len <= mss))
@@ -97,9 +98,10 @@ static struct sk_buff *udp6_ufo_fragment
/* Find the unfragmentable header and shift it left by frag_hdr_sz
* bytes to insert fragment header.
*/
- unfrag_ip6hlen = ip6_find_1stfragopt(skb, &prevhdr);
- if (unfrag_ip6hlen < 0)
- return ERR_PTR(unfrag_ip6hlen);
+ err = ip6_find_1stfragopt(skb, &prevhdr);
+ if (err < 0)
+ return ERR_PTR(err);
+ unfrag_ip6hlen = err;
nexthdr = *prevhdr;
*prevhdr = NEXTHDR_FRAGMENT;
unfrag_len = (skb_network_header(skb) - skb_mac_header(skb)) +
Patches currently in stable-queue which might be from davem@davemloft.net are
queue-4.4/sctp-fix-src-address-selection-if-using-secondary-addresses-for-ipv6.patch
queue-4.4/sctp-fix-icmp-processing-if-skb-is-non-linear.patch
queue-4.4/virtio-net-enable-tso-checksum-offloads-for-q-in-q-vlans.patch
queue-4.4/sctp-do-not-inherit-ipv6_-mc-ac-fl-_list-from-parent.patch
queue-4.4/bridge-start-hello_timer-when-enabling-kernel_stp-in-br_stp_start.patch
queue-4.4/tcp-avoid-fastopen-api-to-be-used-on-af_unspec.patch
queue-4.4/s390-qeth-avoid-null-pointer-dereference-on-osn.patch
queue-4.4/tcp-eliminate-negative-reordering-in-tcp_clean_rtx_queue.patch
queue-4.4/s390-qeth-unbreak-osm-and-osn-support.patch
queue-4.4/netem-fix-skb_orphan_partial.patch
queue-4.4/net-improve-handling-of-failures-on-link-and-route-dumps.patch
queue-4.4/bridge-netlink-check-vlan_default_pvid-range.patch
queue-4.4/dccp-tcp-do-not-inherit-mc_list-from-parent.patch
queue-4.4/vlan-fix-tcp-checksum-offloads-in-q-in-q-vlans.patch
queue-4.4/s390-qeth-handle-sysfs-error-during-initialization.patch
queue-4.4/tcp-avoid-fragmenting-peculiar-skbs-in-sack.patch
queue-4.4/ipv6-dccp-do-not-inherit-ipv6_mc_list-from-parent.patch
queue-4.4/ipv6-prevent-overrun-when-parsing-v6-header-options.patch
queue-4.4/ipv6-check-ip6_find_1stfragopt-return-value-properly.patch
queue-4.4/sparc-fix-wstringop-overflow-warning.patch
queue-4.4/qmi_wwan-add-another-lenovo-em74xx-device-id.patch
queue-4.4/be2net-fix-offload-features-for-q-in-q-packets.patch
queue-4.4/s390-qeth-add-missing-hash-table-initializations.patch
queue-4.4/ipv6-fix-out-of-bound-writes-in-__ip6_append_data.patch
queue-4.4/ipv4-add-reference-counting-to-metrics.patch
queue-4.4/net-phy-marvell-limit-errata-to-88m1101.patch
reply other threads:[~2017-06-02 2:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1496371150192191@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=julia.lawall@lip6.fr \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.