Commit b0355db
Fix XFRM-I support for nested ESP tunnels
This change adds support for nested IPsec tunnels by ensuring that
XFRM-I verifies existing policies before decapsulating a subsequent
policies. Addtionally, this clears the secpath entries after policies
are verified, ensuring that previous tunnels with no-longer-valid
do not pollute subsequent policy checks.
This is necessary especially for nested tunnels, as the IP addresses,
protocol and ports may all change, thus not matching the previous
policies. In order to ensure that packets match the relevant inbound
templates, the xfrm_policy_check should be done before handing off to
the inner XFRM protocol to decrypt and decapsulate.
Notably, raw ESP/AH packets did not perform policy checks inherently,
whereas all other encapsulated packets (UDP, TCP encapsulated) do policy
checks after calling xfrm_input handling in the respective encapsulation
layer.
Test: Verified with additional Android Kernel Unit tests
Signed-off-by: Benedict Wong <[email protected]>
Signed-off-by: Steffen Klassert <[email protected]>1 parent 571f3dd commit b0355db
2 files changed
+53
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
313 | 359 | | |
314 | 360 | | |
315 | 361 | | |
| |||
945 | 991 | | |
946 | 992 | | |
947 | 993 | | |
948 | | - | |
949 | | - | |
| 994 | + | |
| 995 | + | |
950 | 996 | | |
951 | 997 | | |
952 | 998 | | |
| |||
996 | 1042 | | |
997 | 1043 | | |
998 | 1044 | | |
999 | | - | |
1000 | | - | |
| 1045 | + | |
| 1046 | + | |
1001 | 1047 | | |
1002 | 1048 | | |
1003 | 1049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3742 | 3742 | | |
3743 | 3743 | | |
3744 | 3744 | | |
| 3745 | + | |
| 3746 | + | |
| 3747 | + | |
3745 | 3748 | | |
3746 | 3749 | | |
3747 | 3750 | | |
| |||
0 commit comments