skip sizechecking when not specified
Pablo Neira
maintainerPATCH 3/4 skip sizechecking when not specified
This patch applies to nfnetlink. Skip sizecheck if the size of the attribute wasn't specified, ie. zero.
Signed-off-by Pablo Neira Ayuso <[email protected]>
Signature · 2 lines
The dawn of the fourth age of Linux firewalling is coming; a time of great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
Skip sizecheck if the size of the attribute wasn't specified, ie. zero.
Signed-off-by Pablo Neira Ayuso <[email protected]>
include/linux/netfilter/nfnetlink.h +4 -1
@@ -154,11 +154,14 @@ extern void nfattr_parse(struct nfattr *#define nfattr_bad_size (tb, max, cta_min) \ ({ int __i, __res = 0; \ - for (__i=0; __i<max; __i++) \ + for (__i=0; __i<max; __i++) { \ + if (!cta_min[__i]) \ + continue; \ if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){ \ __res = 1; \ break; \ } \ + } \ __res; \ })
Harald Welte
AppliedQuoted 2 lines · Pablo Neira
This patch applies to nfnetlink. Skip sizecheck if the size of the attribute wasn't specified, ie. zero.
thanks, applied.
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie