Blame SOURCES/0068-src-json-fix-constant-parsing-on-bigendian.patch
|
|
bacbc8 |
From 582df543fab12f6c9032ddf6c789a4e0a7242358 Mon Sep 17 00:00:00 2001
|
|
|
bacbc8 |
From: Florian Westphal <fw@strlen.de>
|
|
|
bacbc8 |
Date: Wed, 14 Aug 2019 13:45:19 +0200
|
|
|
bacbc8 |
Subject: [PATCH] src: json: fix constant parsing on bigendian
|
|
|
bacbc8 |
|
|
|
bacbc8 |
json restore is broken on big-endian because we errounously
|
|
|
bacbc8 |
passed uint8_t with 64 bit size indicator.
|
|
|
bacbc8 |
|
|
|
bacbc8 |
On bigendian, this causes all values to get shifted by 56 bit,
|
|
|
bacbc8 |
this will then cause the eval step to bail because all values
|
|
|
bacbc8 |
are outside of the 8bit 0-255 protocol range.
|
|
|
bacbc8 |
|
|
|
bacbc8 |
Signed-off-by: Florian Westphal <fw@strlen.de>
|
|
|
bacbc8 |
Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
|
bacbc8 |
(cherry picked from commit 452e7653334bd2808441fe40235307f1f3dd23c4)
|
|
|
bacbc8 |
Signed-off-by: Phil Sutter <psutter@redhat.com>
|
|
|
bacbc8 |
---
|
|
|
bacbc8 |
src/parser_json.c | 2 +-
|
|
|
bacbc8 |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
bacbc8 |
|
|
|
bacbc8 |
diff --git a/src/parser_json.c b/src/parser_json.c
|
|
|
bacbc8 |
index 7e4da4838e40b..231f377c4f2da 100644
|
|
|
bacbc8 |
--- a/src/parser_json.c
|
|
|
bacbc8 |
+++ b/src/parser_json.c
|
|
|
bacbc8 |
@@ -295,7 +295,7 @@ static struct expr *json_parse_constant(struct json_ctx *ctx, const char *name)
|
|
|
bacbc8 |
return constant_expr_alloc(int_loc,
|
|
|
bacbc8 |
constant_tbl[i].dtype,
|
|
|
bacbc8 |
BYTEORDER_HOST_ENDIAN,
|
|
|
bacbc8 |
- 8 * BITS_PER_BYTE,
|
|
|
bacbc8 |
+ BITS_PER_BYTE,
|
|
|
bacbc8 |
&constant_tbl[i].data);
|
|
|
bacbc8 |
}
|
|
|
bacbc8 |
json_error(ctx, "Unknown constant '%s'.", name);
|
|
|
bacbc8 |
--
|
|
|
bacbc8 |
2.22.0
|
|
|
bacbc8 |
|