Commit 6caf9ef
selftests/bpf: Test sockmap redirect for AF_UNIX MSG_OOB
Verify that out-of-band packets are silently dropped before they reach the
redirection logic.
The idea is to test with a 2 byte long send(). Should a MSG_OOB flag be in
use, only the last byte will be treated as out-of-band. Test fails if
verd_mapfd indicates a wrong number of packets processed (e.g. if OOB
wasn't dropped at the source) or if it was possible to recv() MSG_OOB from
the mapped socket, or if any stale OOB data have been left reachable from
the unmapped socket.
Signed-off-by: Michal Luczaj <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Tested-by: Jakub Sitnicki <[email protected]>
Reviewed-by: Jakub Sitnicki <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]1 parent 0befb34 commit 6caf9ef
1 file changed
+33
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1399 | 1399 | | |
1400 | 1400 | | |
1401 | 1401 | | |
1402 | | - | |
1403 | | - | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
1404 | 1405 | | |
1405 | | - | |
| 1406 | + | |
1406 | 1407 | | |
1407 | 1408 | | |
1408 | 1409 | | |
| |||
1417 | 1418 | | |
1418 | 1419 | | |
1419 | 1420 | | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
1420 | 1440 | | |
1421 | 1441 | | |
1422 | 1442 | | |
| |||
1873 | 1893 | | |
1874 | 1894 | | |
1875 | 1895 | | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
1876 | 1901 | | |
1877 | 1902 | | |
1878 | 1903 | | |
| |||
1888 | 1913 | | |
1889 | 1914 | | |
1890 | 1915 | | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
1891 | 1921 | | |
1892 | 1922 | | |
1893 | 1923 | | |
| |||
0 commit comments