diff --git a/patches.suse/sctp-change-sctp_prot-.no_autobind-with-true.patch b/patches.suse/sctp-change-sctp_prot-.no_autobind-with-true.patch index 2748385..6a166a9 100644 --- a/patches.suse/sctp-change-sctp_prot-.no_autobind-with-true.patch +++ b/patches.suse/sctp-change-sctp_prot-.no_autobind-with-true.patch @@ -1,9 +1,8 @@ From: Xin Long -Date: Tue, 15 Oct 2019 15:24:38 +0800 Subject: sctp: change sctp_prot .no_autobind with true +Patch-mainline: v5.4-rc4 Git-commit: 63dfb7938b13fa2c2fbcb45f34d065769eb09414 -Patch-mainline: 5.4-rc4 -References: networking-stable-19_10_24 +References: networking-stable-19_10_24 bsc#1158082 syzbot reported a memory leak: @@ -43,10 +42,28 @@ Signed-off-by: Xin Long Acked-by: Marcelo Ricardo Leitner Signed-off-by: David S. Miller Signed-off-by: Jiri Slaby +Signed-off-by: Michal Kubecek + +SLE15: we need to check no_autobind socket flag in inet_dgram_connect() as, +unlike in mainline, SCTP still uses this function. + --- - net/sctp/socket.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) + net/ipv4/af_inet.c | 3 ++- + net/sctp/socket.c | 4 ++-- + 2 files changed, 4 insertions(+), 3 deletions(-) +--- a/net/ipv4/af_inet.c ++++ b/net/ipv4/af_inet.c +@@ -535,7 +535,8 @@ int inet_dgram_connect(struct socket *sock, struct sockaddr *uaddr, + if (uaddr->sa_family == AF_UNSPEC) + return sk->sk_prot->disconnect(sk, flags); + +- if (!inet_sk(sk)->inet_num && inet_autobind(sk)) ++ if (!inet_sk(sk)->inet_num && !sk->sk_prot->no_autobind && ++ inet_autobind(sk)) + return -EAGAIN; + return sk->sk_prot->connect(sk, uaddr, addr_len); + } --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -8240,7 +8240,7 @@ struct proto sctp_prot = {