Commit 04f1991
sctp: move the format error check out of __sctp_sf_do_9_1_abort
[ Upstream commit 245709e ]
When T2 timer is to be stopped, the asoc should also be deleted,
otherwise, there will be no chance to call sctp_association_free
and the asoc could last in memory forever.
However, in sctp_sf_shutdown_sent_abort(), after adding the cmd
SCTP_CMD_TIMER_STOP for T2 timer, it may return error due to the
format error from __sctp_sf_do_9_1_abort() and miss adding
SCTP_CMD_ASSOC_FAILED where the asoc will be deleted.
This patch is to fix it by moving the format error check out of
__sctp_sf_do_9_1_abort(), and do it before adding the cmd
SCTP_CMD_TIMER_STOP for T2 timer.
Thanks Hangbin for reporting this issue by the fuzz testing.
v1->v2:
- improve the comment in the code as Marcelo's suggestion.
Fixes: 96ca468 ("sctp: check invalid value of length parameter in error cause")
Reported-by: Hangbin Liu <liuhangbin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent c6ed56c commit 04f1991
1 file changed
+20
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
173 | 183 | | |
174 | 184 | | |
175 | 185 | | |
| |||
2255 | 2265 | | |
2256 | 2266 | | |
2257 | 2267 | | |
| 2268 | + | |
| 2269 | + | |
| 2270 | + | |
2258 | 2271 | | |
2259 | 2272 | | |
2260 | 2273 | | |
| |||
2298 | 2311 | | |
2299 | 2312 | | |
2300 | 2313 | | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
2301 | 2317 | | |
2302 | 2318 | | |
2303 | 2319 | | |
| |||
2565 | 2581 | | |
2566 | 2582 | | |
2567 | 2583 | | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
2568 | 2587 | | |
2569 | 2588 | | |
2570 | 2589 | | |
| |||
2582 | 2601 | | |
2583 | 2602 | | |
2584 | 2603 | | |
2585 | | - | |
2586 | | - | |
2587 | | - | |
2588 | | - | |
2589 | | - | |
2590 | | - | |
2591 | | - | |
2592 | | - | |
| 2604 | + | |
2593 | 2605 | | |
2594 | | - | |
2595 | 2606 | | |
2596 | 2607 | | |
2597 | 2608 | | |
| |||
0 commit comments