Repository navigation
Commit a940c19
sctp: return error if the asoc has been peeled off in sctp_wait_for_sndbuf
[ Upstream commit a0ff660 ]
After commit cea0cc8 ("sctp: use the right sk after waking up from
wait_buf sleep"), it may change to lock another sk if the asoc has been
peeled off in sctp_wait_for_sndbuf.
However, the asoc's new sk could be already closed elsewhere, as it's in
the sendmsg context of the old sk that can't avoid the new sk's closing.
If the sk's last one refcnt is held by this asoc, later on after putting
this asoc, the new sk will be freed, while under it's own lock.
This patch is to revert that commit, but fix the old issue by returning
error under the old sk's lock.
Fixes: cea0cc8 ("sctp: use the right sk after waking up from wait_buf sleep")
Reported-by: syzbot+ac6ea7baa4432811eb50@syzkaller.appspotmail.com
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent f2e9570 commit a940c19
1 file changed
Lines changed: 6 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
1964 | | - | |
| 1964 | + | |
1965 | 1965 | | |
1966 | 1966 | | |
1967 | 1967 | | |
| |||
7825 | 7825 | | |
7826 | 7826 | | |
7827 | 7827 | | |
7828 | | - | |
| 7828 | + | |
7829 | 7829 | | |
7830 | 7830 | | |
7831 | | - | |
7832 | 7831 | | |
7833 | 7832 | | |
| 7833 | + | |
7834 | 7834 | | |
7835 | 7835 | | |
7836 | 7836 | | |
| |||
7859 | 7859 | | |
7860 | 7860 | | |
7861 | 7861 | | |
7862 | | - | |
7863 | | - | |
7864 | | - | |
7865 | | - | |
7866 | | - | |
| 7862 | + | |
| 7863 | + | |
7867 | 7864 | | |
7868 | 7865 | | |
7869 | 7866 | | |
7870 | 7867 | | |
7871 | 7868 | | |
7872 | | - | |
7873 | 7869 | | |
7874 | 7870 | | |
7875 | 7871 | | |
| |||
0 commit comments