Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1224391 > unrolled thread
| Started by | Joe Stringer <joestringer@nicira.com> |
|---|---|
| First post | 2015-09-14 20:20 +0200 |
| Last post | 2015-09-18 00:40 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH net] openvswitch: Fix IPv6 exthdr handling with ct helpers. Joe Stringer <joestringer@nicira.com> - 2015-09-14 20:20 +0200
Re: [PATCH net] openvswitch: Fix IPv6 exthdr handling with ct helpers. Pravin Shelar <pshelar@nicira.com> - 2015-09-15 02:00 +0200
Re: [PATCH net] openvswitch: Fix IPv6 exthdr handling with ct helpers. David Miller <davem@davemloft.net> - 2015-09-18 00:40 +0200
| From | Joe Stringer <joestringer@nicira.com> |
|---|---|
| Date | 2015-09-14 20:20 +0200 |
| Subject | [PATCH net] openvswitch: Fix IPv6 exthdr handling with ct helpers. |
| Message-ID | <q8Gwa-5zh-15@gated-at.bofh.it> |
Static code analysis reveals the following bug:
net/openvswitch/conntrack.c:281 ovs_ct_helper()
warn: unsigned 'protoff' is never less than zero.
This signedness bug breaks error handling for IPv6 extension headers when
using conntrack helpers. Fix the error by using a local signed variable.
Fixes: cae3a2627520: "openvswitch: Allow attaching helpers to ct
action"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
---
net/openvswitch/conntrack.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index e8e524a..002a755 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -275,13 +275,15 @@ static int ovs_ct_helper(struct sk_buff *skb, u16 proto)
case NFPROTO_IPV6: {
u8 nexthdr = ipv6_hdr(skb)->nexthdr;
__be16 frag_off;
+ int ofs;
- protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr),
- &nexthdr, &frag_off);
- if (protoff < 0 || (frag_off & htons(~0x7)) != 0) {
+ ofs = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &nexthdr,
+ &frag_off);
+ if (ofs < 0 || (frag_off & htons(~0x7)) != 0) {
pr_debug("proto header not found\n");
return NF_ACCEPT;
}
+ protoff = ofs;
break;
}
default:
--
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Pravin Shelar <pshelar@nicira.com> |
|---|---|
| Date | 2015-09-15 02:00 +0200 |
| Message-ID | <q8LPb-4Cp-1@gated-at.bofh.it> |
| In reply to | #1224391 |
On Mon, Sep 14, 2015 at 11:14 AM, Joe Stringer <joestringer@nicira.com> wrote: > Static code analysis reveals the following bug: > > net/openvswitch/conntrack.c:281 ovs_ct_helper() > warn: unsigned 'protoff' is never less than zero. > > This signedness bug breaks error handling for IPv6 extension headers when > using conntrack helpers. Fix the error by using a local signed variable. > > Fixes: cae3a2627520: "openvswitch: Allow attaching helpers to ct > action" > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> > Signed-off-by: Joe Stringer <joestringer@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2015-09-18 00:40 +0200 |
| Subject | Re: [PATCH net] openvswitch: Fix IPv6 exthdr handling with ct helpers. |
| Message-ID | <q9Q0p-De-7@gated-at.bofh.it> |
| In reply to | #1224391 |
From: Joe Stringer <joestringer@nicira.com> Date: Mon, 14 Sep 2015 11:14:50 -0700 > Static code analysis reveals the following bug: > > net/openvswitch/conntrack.c:281 ovs_ct_helper() > warn: unsigned 'protoff' is never less than zero. > > This signedness bug breaks error handling for IPv6 extension headers when > using conntrack helpers. Fix the error by using a local signed variable. > > Fixes: cae3a2627520: "openvswitch: Allow attaching helpers to ct > action" > Reported-by: Dan Carpenter <dan.carpenter@oracle.com> > Signed-off-by: Joe Stringer <joestringer@nicira.com> Applied, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web