xfrm: espintcp: reorder operations within espintcp_init_sk
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Original description
In the Linux kernel, the following vulnerability has been resolved:
xfrm: espintcp: reorder operations within espintcp_init_sk
When enabled on a socket, espintcp sets the socket callbacks to its own before it has finished setting up its context and published it as icsk_ulp_data. Any one of those callbacks that gets called before will dereference a NULL icsk_ulp_data.
Fix this by reording the operations, and add memory barriers to ensure callers will have a struct espintcp_ctx available. Add a few WRITE_ONCE/READ_ONCE too while we're there.
From the CVE record · Linux