Commit 4039ce7
netfilter: nf_tables: Introduce NFTA_DEVICE_PREFIX
This new attribute is supposed to be used instead of NFTA_DEVICE_NAME
for simple wildcard interface specs. It holds a NUL-terminated string
representing an interface name prefix to match on.
While kernel code to distinguish full names from prefixes in
NFTA_DEVICE_NAME is simpler than this solution, reusing the existing
attribute with different semantics leads to confusion between different
versions of kernel and user space though:
* With old kernels, wildcards submitted by user space are accepted yet
silently treated as regular names.
* With old user space, wildcards submitted by kernel may cause crashes
since libnftnl expects NUL-termination when there is none.
Using a distinct attribute type sanitizes these situations as the
receiving part detects and rejects the unexpected attribute nested in
*_HOOK_DEVS attributes.
Fixes: 6d07a28 ("netfilter: nf_tables: Support wildcard netdev hook specs")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>1 parent 661a4f3 commit 4039ce7
2 files changed
Lines changed: 33 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1784 | 1784 | | |
1785 | 1785 | | |
1786 | 1786 | | |
| 1787 | + | |
1787 | 1788 | | |
1788 | 1789 | | |
1789 | 1790 | | |
1790 | 1791 | | |
| 1792 | + | |
1791 | 1793 | | |
1792 | 1794 | | |
1793 | 1795 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1959 | 1959 | | |
1960 | 1960 | | |
1961 | 1961 | | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
1962 | 1974 | | |
1963 | 1975 | | |
1964 | 1976 | | |
| |||
1990 | 2002 | | |
1991 | 2003 | | |
1992 | 2004 | | |
1993 | | - | |
1994 | | - | |
| 2005 | + | |
1995 | 2006 | | |
1996 | 2007 | | |
1997 | 2008 | | |
1998 | 2009 | | |
1999 | 2010 | | |
2000 | 2011 | | |
2001 | | - | |
2002 | | - | |
| 2012 | + | |
| 2013 | + | |
2003 | 2014 | | |
2004 | 2015 | | |
2005 | 2016 | | |
| |||
2310 | 2321 | | |
2311 | 2322 | | |
2312 | 2323 | | |
2313 | | - | |
| 2324 | + | |
| 2325 | + | |
2314 | 2326 | | |
2315 | 2327 | | |
2316 | 2328 | | |
| |||
2327 | 2339 | | |
2328 | 2340 | | |
2329 | 2341 | | |
2330 | | - | |
| 2342 | + | |
| 2343 | + | |
2331 | 2344 | | |
2332 | 2345 | | |
2333 | 2346 | | |
| |||
2374 | 2387 | | |
2375 | 2388 | | |
2376 | 2389 | | |
| 2390 | + | |
2377 | 2391 | | |
2378 | 2392 | | |
2379 | | - | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
2380 | 2401 | | |
2381 | 2402 | | |
2382 | 2403 | | |
2383 | 2404 | | |
2384 | | - | |
| 2405 | + | |
2385 | 2406 | | |
2386 | 2407 | | |
2387 | 2408 | | |
| |||
2427 | 2448 | | |
2428 | 2449 | | |
2429 | 2450 | | |
2430 | | - | |
| 2451 | + | |
2431 | 2452 | | |
2432 | 2453 | | |
2433 | 2454 | | |
| |||
9458 | 9479 | | |
9459 | 9480 | | |
9460 | 9481 | | |
9461 | | - | |
9462 | | - | |
| 9482 | + | |
9463 | 9483 | | |
9464 | 9484 | | |
9465 | 9485 | | |
| |||
0 commit comments