* [Qemu-devel] [PATCH v2] l2tpv3: fix cookie decoding
@ 2016-01-04 23:26 Alexis Dambricourt
2016-01-06 3:01 ` Jason Wang
0 siblings, 1 reply; 2+ messages in thread
From: Alexis Dambricourt @ 2016-01-04 23:26 UTC (permalink / raw)
To: qemu-devel; +Cc: jasowang
If a 32 bits l2tpv3 frame cookie MSB if set to 1, the cast to uint64_t
cookie will spread 1 to the four most significant bytes.
Then the condition (cookie != s->rx_cookie) becomes false.
Signed-off-by: Alexis Dambricourt <alexis.dambricourt@gmail.com>
---
net/l2tpv3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 8e68e54..21d6119 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -325,7 +325,7 @@ static int l2tpv3_verify_header(NetL2TPV3State *s, uint8_t *buf)
if (s->cookie_is_64) {
cookie = ldq_be_p(buf + s->cookie_offset);
} else {
- cookie = ldl_be_p(buf + s->cookie_offset);
+ cookie = ldl_be_p(buf + s->cookie_offset) & 0xffffffffULL;
}
if (cookie != s->rx_cookie) {
if (!s->header_mismatch) {
--
2.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] l2tpv3: fix cookie decoding
2016-01-04 23:26 [Qemu-devel] [PATCH v2] l2tpv3: fix cookie decoding Alexis Dambricourt
@ 2016-01-06 3:01 ` Jason Wang
0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2016-01-06 3:01 UTC (permalink / raw)
To: Alexis Dambricourt, qemu-devel
On 01/05/2016 07:26 AM, Alexis Dambricourt wrote:
> If a 32 bits l2tpv3 frame cookie MSB if set to 1, the cast to uint64_t
> cookie will spread 1 to the four most significant bytes.
> Then the condition (cookie != s->rx_cookie) becomes false.
>
> Signed-off-by: Alexis Dambricourt <alexis.dambricourt@gmail.com>
> ---
> net/l2tpv3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/l2tpv3.c b/net/l2tpv3.c
> index 8e68e54..21d6119 100644
> --- a/net/l2tpv3.c
> +++ b/net/l2tpv3.c
> @@ -325,7 +325,7 @@ static int l2tpv3_verify_header(NetL2TPV3State *s, uint8_t *buf)
> if (s->cookie_is_64) {
> cookie = ldq_be_p(buf + s->cookie_offset);
> } else {
> - cookie = ldl_be_p(buf + s->cookie_offset);
> + cookie = ldl_be_p(buf + s->cookie_offset) & 0xffffffffULL;
> }
> if (cookie != s->rx_cookie) {
> if (!s->header_mismatch) {
Applied to my -net.
Thanks
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-01-06 3:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-04 23:26 [Qemu-devel] [PATCH v2] l2tpv3: fix cookie decoding Alexis Dambricourt
2016-01-06 3:01 ` Jason Wang
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.