Commit c9f3f81
committed
xfrm: Fix stack-out-of-bounds read in xfrm_state_find.
When we do tunnel or beet mode, we pass saddr and daddr from the
template to xfrm_state_find(), this is ok. On transport mode,
we pass the addresses from the flowi, assuming that the IP
addresses (and address family) don't change during transformation.
This assumption is wrong in the IPv4 mapped IPv6 case, packet
is IPv4 and template is IPv6. Fix this by using the addresses
from the template unconditionally.
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>1 parent cf37966 commit c9f3f81
1 file changed
Lines changed: 11 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1361 | 1361 | | |
1362 | 1362 | | |
1363 | 1363 | | |
1364 | | - | |
1365 | | - | |
1366 | 1364 | | |
1367 | 1365 | | |
1368 | 1366 | | |
1369 | 1367 | | |
1370 | | - | |
1371 | | - | |
| 1368 | + | |
| 1369 | + | |
1372 | 1370 | | |
1373 | 1371 | | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
1382 | | - | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
1386 | 1381 | | |
1387 | 1382 | | |
1388 | 1383 | | |
1389 | 1384 | | |
1390 | 1385 | | |
1391 | 1386 | | |
1392 | | - | |
1393 | | - | |
1394 | 1387 | | |
1395 | 1388 | | |
1396 | 1389 | | |
| |||
0 commit comments