All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH nft] meta: fix error checks in tc handle parser
@ 2016-02-01 11:02 Florian Westphal
  2016-02-01 17:53 ` Pablo Neira Ayuso
  2016-02-16 18:25 ` Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Florian Westphal @ 2016-02-01 11:02 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Florian Westphal

'meta priority foobar' did not return an error -- instead
we used min/max values with undefined content.

Signed-off-by: Florian Westphal <fw@strlen.de>
---
 src/meta.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/meta.c b/src/meta.c
index 8cbc974..7f12f0c 100644
--- a/src/meta.c
+++ b/src/meta.c
@@ -100,17 +100,17 @@ static struct error_record *tchandle_type_parse(const struct expr *sym,
 	else if (strcmp(sym->identifier, "none") == 0)
 		handle = TC_H_UNSPEC;
 	else if (sym->identifier[0] == ':') {
-		if (sscanf(sym->identifier, ":%04x", &handle) < 0)
+		if (sscanf(sym->identifier, ":%04x", &handle) != 1)
 			goto err;
 	} else if (sym->identifier[strlen(sym->identifier)-1] == ':') {
-		if (sscanf(sym->identifier, "%04x:", &handle) < 0)
+		if (sscanf(sym->identifier, "%04x:", &handle) != 1)
 			goto err;
 
 		handle <<= 16;
 	} else {
 		uint32_t min, max;
 
-		if (sscanf(sym->identifier, "%04x:%04x", &min, &max) < 0)
+		if (sscanf(sym->identifier, "%04x:%04x", &min, &max) != 2)
 			goto err;
 
 		handle = max << 16 | min;
-- 
2.4.10


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH nft] meta: fix error checks in tc handle parser
  2016-02-01 11:02 [PATCH nft] meta: fix error checks in tc handle parser Florian Westphal
@ 2016-02-01 17:53 ` Pablo Neira Ayuso
  2016-02-01 20:02   ` Florian Westphal
  2016-02-16 18:25 ` Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-02-01 17:53 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

On Mon, Feb 01, 2016 at 12:02:36PM +0100, Florian Westphal wrote:
> 'meta priority foobar' did not return an error -- instead
> we used min/max values with undefined content.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

Fine with me. IIRC, the scanner is still broken though.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH nft] meta: fix error checks in tc handle parser
  2016-02-01 17:53 ` Pablo Neira Ayuso
@ 2016-02-01 20:02   ` Florian Westphal
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Westphal @ 2016-02-01 20:02 UTC (permalink / raw)
  To: Pablo Neira Ayuso; +Cc: Florian Westphal, netfilter-devel

Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> On Mon, Feb 01, 2016 at 12:02:36PM +0100, Florian Westphal wrote:
> > 'meta priority foobar' did not return an error -- instead
> > we used min/max values with undefined content.
> > 
> > Signed-off-by: Florian Westphal <fw@strlen.de>
> 
> Fine with me. IIRC, the scanner is still broken though.

Ho-hum.  It is.  And I don't see how this can be fixed.
Teaching scanner.l about

tchandle       {hexdigit}{4}:{hexdigit}{4}

breaks

tcp sport vmap { 1225:accept, }

( 1225:acc is handle).


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH nft] meta: fix error checks in tc handle parser
  2016-02-01 11:02 [PATCH nft] meta: fix error checks in tc handle parser Florian Westphal
  2016-02-01 17:53 ` Pablo Neira Ayuso
@ 2016-02-16 18:25 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2016-02-16 18:25 UTC (permalink / raw)
  To: Florian Westphal; +Cc: netfilter-devel

On Mon, Feb 01, 2016 at 12:02:36PM +0100, Florian Westphal wrote:
> 'meta priority foobar' did not return an error -- instead
> we used min/max values with undefined content.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

I know this is still not the full fix for this, but I would like to
make sure this doesn't get lost, so go push it. Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-16 18:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 11:02 [PATCH nft] meta: fix error checks in tc handle parser Florian Westphal
2016-02-01 17:53 ` Pablo Neira Ayuso
2016-02-01 20:02   ` Florian Westphal
2016-02-16 18:25 ` Pablo Neira Ayuso

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.