Revert "net: Fix TOCTOU issue in sk_is_readable()"

This reverts commit c2b2663847 which is
commit 2660a544fdc0940bba15f70508a46cf9a6491230 upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Ib2d18080c1dc4b9b44ae64d406f8b9b38a845ac7
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman
2025-07-02 06:48:57 +00:00
parent 3d9d456ab7
commit 4c6e1c7bf0

View File

@@ -2850,11 +2850,8 @@ int sock_bind_add(struct sock *sk, struct sockaddr *addr, int addr_len);
static inline bool sk_is_readable(struct sock *sk)
{
const struct proto *prot = READ_ONCE(sk->sk_prot);
if (prot->sock_is_readable)
return prot->sock_is_readable(sk);
if (sk->sk_prot->sock_is_readable)
return sk->sk_prot->sock_is_readable(sk);
return false;
}
#endif /* _SOCK_H */