Skip to content

Commit 9b94c36

Browse files
author
CKI KWF Bot
committed
Merge: tcp: stable backports from upstream for 9.8 phase 2
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7456 JIRA: https://issues.redhat.com/browse/RHEL-115628 CVE: CVE-2025-39955 A couple of fixes from upstream addressing critical issues, and a related follow-up Signed-off-by: Paolo Abeni <pabeni@redhat.com> Approved-by: Florian Westphal <fwestpha@redhat.com> Approved-by: Hangbin Liu <haliu@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
2 parents e70c84f + 72a790b commit 9b94c36

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

net/ipv4/tcp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3168,6 +3168,7 @@ int tcp_disconnect(struct sock *sk, int flags)
31683168
struct inet_connection_sock *icsk = inet_csk(sk);
31693169
struct tcp_sock *tp = tcp_sk(sk);
31703170
int old_state = sk->sk_state;
3171+
struct request_sock *req;
31713172
u32 seq;
31723173

31733174
if (old_state != TCP_CLOSE)
@@ -3278,6 +3279,10 @@ int tcp_disconnect(struct sock *sk, int flags)
32783279

32793280

32803281
/* Clean up fastopen related fields */
3282+
req = rcu_dereference_protected(tp->fastopen_rsk,
3283+
lockdep_sock_is_held(sk));
3284+
if (req)
3285+
reqsk_fastopen_remove(sk, req, false);
32813286
tcp_free_fastopen_req(tp);
32823287
inet->defer_connect = 0;
32833288
tp->fastopen_client_fail = 0;

net/ipv4/tcp_input.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7108,7 +7108,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
71087108
&foc, TCP_SYNACK_FASTOPEN, skb);
71097109
/* Add the child socket directly into the accept queue */
71107110
if (!inet_csk_reqsk_queue_add(sk, req, fastopen_sk)) {
7111-
reqsk_fastopen_remove(fastopen_sk, req, false);
71127111
bh_unlock_sock(fastopen_sk);
71137112
sock_put(fastopen_sk);
71147113
goto drop_and_free;

net/ipv4/tcp_output.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,10 @@ static unsigned int tcp_syn_options(struct sock *sk, struct sk_buff *skb,
828828
unsigned int size;
829829

830830
if (mptcp_syn_options(sk, skb, &size, &opts->mptcp)) {
831-
opts->options |= OPTION_MPTCP;
832-
remaining -= size;
831+
if (remaining >= size) {
832+
opts->options |= OPTION_MPTCP;
833+
remaining -= size;
834+
}
833835
}
834836
}
835837

0 commit comments

Comments
 (0)