Commit eceae70
selftests/bpf: Fix invalid use of strncat in test_sockmap
strncat()'s third argument is how many bytes will be added *in addition* to already existing bytes in destination. Plus extra zero byte will be added after that. So existing use in test_sockmap has many opportunities to overflow the string and cause memory corruptions. And in this case, GCC complains for a good reason. Fixes: 16962b2 ("bpf: sockmap, add selftests") Fixes: 73563aa ("selftests/bpf: test_sockmap, print additional test options") Fixes: 1ade9ab ("bpf: test_sockmap, add options for msg_pop_data() helper") Fixes: 463bac5 ("bpf, selftests: Add test for ktls with skb bpf ingress policy") Fixes: e9dd904 ("bpf: add tls support for testing in test_sockmap") Fixes: 753fb2e ("bpf: sockmap, add msg_peek tests to test_sockmap") Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20201203235440.2302137-2-andrii@kernel.org1 parent 3015b50 commit eceae70
1 file changed
+23
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
1276 | 1286 | | |
1277 | 1287 | | |
1278 | 1288 | | |
| |||
1281 | 1291 | | |
1282 | 1292 | | |
1283 | 1293 | | |
1284 | | - | |
| 1294 | + | |
1285 | 1295 | | |
1286 | | - | |
| 1296 | + | |
1287 | 1297 | | |
1288 | | - | |
| 1298 | + | |
1289 | 1299 | | |
1290 | 1300 | | |
1291 | | - | |
| 1301 | + | |
1292 | 1302 | | |
1293 | 1303 | | |
1294 | 1304 | | |
1295 | | - | |
| 1305 | + | |
1296 | 1306 | | |
1297 | 1307 | | |
1298 | 1308 | | |
1299 | | - | |
| 1309 | + | |
1300 | 1310 | | |
1301 | 1311 | | |
1302 | 1312 | | |
1303 | | - | |
| 1313 | + | |
1304 | 1314 | | |
1305 | 1315 | | |
1306 | 1316 | | |
1307 | 1317 | | |
1308 | | - | |
| 1318 | + | |
1309 | 1319 | | |
1310 | 1320 | | |
1311 | | - | |
| 1321 | + | |
1312 | 1322 | | |
1313 | | - | |
| 1323 | + | |
1314 | 1324 | | |
1315 | | - | |
| 1325 | + | |
1316 | 1326 | | |
1317 | | - | |
| 1327 | + | |
1318 | 1328 | | |
1319 | | - | |
| 1329 | + | |
1320 | 1330 | | |
1321 | 1331 | | |
1322 | 1332 | | |
| |||
0 commit comments