Skip to content

Commit 9e166df

Browse files
committed
net: forward_alloc_get depends on CONFIG_MPTCP
jira VULN-65244 cve-pre CVE-2025-22058 commit-author Eric Dumazet <edumazet@google.com> commit 6c302e7 (struct proto)->sk_forward_alloc is currently only used by MPTCP. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net> (cherry picked from commit 6c302e7) Signed-off-by: Brett Mastbergen <bmastbergen@ciq.com>
1 parent 1c6c444 commit 9e166df

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

include/net/sock.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,9 @@ struct proto {
12731273
unsigned int inuse_idx;
12741274
#endif
12751275

1276+
#if IS_ENABLED(CONFIG_MPTCP)
12761277
int (*forward_alloc_get)(const struct sock *sk);
1278+
#endif
12771279

12781280
bool (*stream_memory_free)(const struct sock *sk, int wake);
12791281
bool (*sock_is_readable)(struct sock *sk);
@@ -1363,10 +1365,11 @@ INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int
13631365

13641366
static inline int sk_forward_alloc_get(const struct sock *sk)
13651367
{
1366-
if (!sk->sk_prot->forward_alloc_get)
1367-
return sk->sk_forward_alloc;
1368-
1369-
return sk->sk_prot->forward_alloc_get(sk);
1368+
#if IS_ENABLED(CONFIG_MPTCP)
1369+
if (sk->sk_prot->forward_alloc_get)
1370+
return sk->sk_prot->forward_alloc_get(sk);
1371+
#endif
1372+
return sk->sk_forward_alloc;
13701373
}
13711374

13721375
static inline bool __sk_stream_memory_free(const struct sock *sk, int wake)

0 commit comments

Comments
 (0)