Commit e9c2b9f
netlink: fix netlink_ack() extack race
[ Upstream commit 48044eb ]
It seems that it's possible to toggle NETLINK_F_EXT_ACK
through setsockopt() while another thread/CPU is building
a message inside netlink_ack(), which could then trigger
the WARN_ON()s I added since if it goes from being turned
off to being turned on between allocating and filling the
message, the skb could end up being too small.
Avoid this whole situation by storing the value of this
flag in a separate variable and using that throughout the
function instead.
Fixes: 2d4bc93 ("netlink: extended ACK reporting")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent aa9ab97 commit e9c2b9f
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2299 | 2299 | | |
2300 | 2300 | | |
2301 | 2301 | | |
| 2302 | + | |
2302 | 2303 | | |
2303 | 2304 | | |
2304 | 2305 | | |
| |||
2309 | 2310 | | |
2310 | 2311 | | |
2311 | 2312 | | |
2312 | | - | |
| 2313 | + | |
2313 | 2314 | | |
2314 | 2315 | | |
2315 | 2316 | | |
| |||
2318 | 2319 | | |
2319 | 2320 | | |
2320 | 2321 | | |
2321 | | - | |
2322 | | - | |
| 2322 | + | |
2323 | 2323 | | |
2324 | 2324 | | |
2325 | 2325 | | |
| |||
2347 | 2347 | | |
2348 | 2348 | | |
2349 | 2349 | | |
2350 | | - | |
| 2350 | + | |
2351 | 2351 | | |
2352 | 2352 | | |
2353 | 2353 | | |
| |||
0 commit comments