Commit 047b64d
committed
net, neigh: Extend neigh->flags to 32 bit to allow for extensions
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2193175
Conflicts:
- context conflict due to existing backport of 77a23b1 ("net:
add net device refcount tracker to struct pneigh_entry")
commit 2c611ad
Author: Roopa Prabhu <roopa@nvidia.com>
Date: Mon Oct 11 14:12:37 2021 +0200
net, neigh: Extend neigh->flags to 32 bit to allow for extensions
Currently, all bits in struct ndmsg's ndm_flags are used up with the most
recent addition of 435f2e7 ("net: bridge: add support for sticky fdb
entries"). This makes it impossible to extend the neighboring subsystem
with new NTF_* flags:
struct ndmsg {
__u8 ndm_family;
__u8 ndm_pad1;
__u16 ndm_pad2;
__s32 ndm_ifindex;
__u16 ndm_state;
__u8 ndm_flags;
__u8 ndm_type;
};
There are ndm_pad{1,2} attributes which are not used. However, due to
uncareful design, the kernel does not enforce them to be zero upon new
neighbor entry addition, and given they've been around forever, it is
not possible to reuse them today due to risk of breakage. One option to
overcome this limitation is to add a new NDA_FLAGS_EXT attribute for
extended flags.
In struct neighbour, there is a 3 byte hole between protocol and ha_lock,
which allows neigh->flags to be extended from 8 to 32 bits while still
being on the same cacheline as before. This also allows for all future
NTF_* flags being in neigh->flags rather than yet another flags field.
Unknown flags in NDA_FLAGS_EXT will be rejected by the kernel.
Co-developed-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Roopa Prabhu <roopa@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>1 parent 52a0f49 commit 047b64d
File tree
3 files changed
+50
-20
lines changed- include
- net
- uapi/linux
- net/core
3 files changed
+50
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
152 | 151 | | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
175 | 175 | | |
176 | 176 | | |
177 | 177 | | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
264 | 268 | | |
265 | 269 | | |
266 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
162 | | - | |
| 162 | + | |
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
382 | | - | |
| 382 | + | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
581 | | - | |
| 581 | + | |
582 | 582 | | |
583 | 583 | | |
584 | 584 | | |
| |||
1788 | 1788 | | |
1789 | 1789 | | |
1790 | 1790 | | |
| 1791 | + | |
1791 | 1792 | | |
1792 | 1793 | | |
1793 | 1794 | | |
| |||
1860 | 1861 | | |
1861 | 1862 | | |
1862 | 1863 | | |
1863 | | - | |
| 1864 | + | |
1864 | 1865 | | |
1865 | 1866 | | |
1866 | 1867 | | |
| |||
1869 | 1870 | | |
1870 | 1871 | | |
1871 | 1872 | | |
| 1873 | + | |
1872 | 1874 | | |
1873 | 1875 | | |
1874 | 1876 | | |
| |||
1884 | 1886 | | |
1885 | 1887 | | |
1886 | 1888 | | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
1887 | 1899 | | |
1888 | 1900 | | |
1889 | 1901 | | |
| |||
1911 | 1923 | | |
1912 | 1924 | | |
1913 | 1925 | | |
1914 | | - | |
1915 | | - | |
| 1926 | + | |
1916 | 1927 | | |
1917 | 1928 | | |
1918 | 1929 | | |
1919 | 1930 | | |
1920 | 1931 | | |
1921 | | - | |
| 1932 | + | |
1922 | 1933 | | |
1923 | 1934 | | |
1924 | 1935 | | |
| |||
1946 | 1957 | | |
1947 | 1958 | | |
1948 | 1959 | | |
1949 | | - | |
| 1960 | + | |
1950 | 1961 | | |
1951 | | - | |
| 1962 | + | |
1952 | 1963 | | |
1953 | 1964 | | |
1954 | 1965 | | |
| |||
1968 | 1979 | | |
1969 | 1980 | | |
1970 | 1981 | | |
1971 | | - | |
| 1982 | + | |
1972 | 1983 | | |
1973 | | - | |
| 1984 | + | |
1974 | 1985 | | |
1975 | | - | |
| 1986 | + | |
1976 | 1987 | | |
1977 | 1988 | | |
1978 | 1989 | | |
1979 | 1990 | | |
1980 | | - | |
| 1991 | + | |
1981 | 1992 | | |
1982 | 1993 | | |
1983 | 1994 | | |
| |||
2432 | 2443 | | |
2433 | 2444 | | |
2434 | 2445 | | |
| 2446 | + | |
2435 | 2447 | | |
2436 | 2448 | | |
2437 | 2449 | | |
| |||
2441 | 2453 | | |
2442 | 2454 | | |
2443 | 2455 | | |
| 2456 | + | |
| 2457 | + | |
| 2458 | + | |
2444 | 2459 | | |
2445 | 2460 | | |
2446 | 2461 | | |
2447 | 2462 | | |
2448 | | - | |
| 2463 | + | |
2449 | 2464 | | |
2450 | 2465 | | |
2451 | 2466 | | |
| |||
2476 | 2491 | | |
2477 | 2492 | | |
2478 | 2493 | | |
| 2494 | + | |
| 2495 | + | |
2479 | 2496 | | |
2480 | 2497 | | |
2481 | 2498 | | |
| |||
2489 | 2506 | | |
2490 | 2507 | | |
2491 | 2508 | | |
| 2509 | + | |
2492 | 2510 | | |
2493 | 2511 | | |
2494 | 2512 | | |
2495 | 2513 | | |
2496 | 2514 | | |
2497 | 2515 | | |
2498 | 2516 | | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
2499 | 2520 | | |
2500 | 2521 | | |
2501 | 2522 | | |
2502 | 2523 | | |
2503 | | - | |
| 2524 | + | |
2504 | 2525 | | |
2505 | 2526 | | |
2506 | 2527 | | |
| |||
2510 | 2531 | | |
2511 | 2532 | | |
2512 | 2533 | | |
| 2534 | + | |
| 2535 | + | |
2513 | 2536 | | |
2514 | 2537 | | |
2515 | 2538 | | |
| |||
2818 | 2841 | | |
2819 | 2842 | | |
2820 | 2843 | | |
| 2844 | + | |
2821 | 2845 | | |
2822 | 2846 | | |
2823 | 2847 | | |
| |||
2846 | 2870 | | |
2847 | 2871 | | |
2848 | 2872 | | |
| 2873 | + | |
2849 | 2874 | | |
2850 | 2875 | | |
2851 | 2876 | | |
| |||
0 commit comments