> [Severity: Medium]
>
> Should a nonblocking reader get -EAGAIN here instead of -EINTR? With
> MSG_DONTWAIT, sock_rcvtimeo(sk, true) returns 0, so sock_intr_errno(0)
> returns -EINTR. This check also runs before any !timeo test.

Yes. The v4 repost will return -EAGAIN when the receive timeout is
zero, as tls_rx_reader_acquire() does, here and in the splice check.

> [Severity: High]
>
> Does this put a limit on a run of empty records when the reader has
> copied nothing?

The patch does not claim to. The reader runs in its own syscall
context, holds only its own socket's lock, and reschedules on each
backlog flush. A budget exit from recvmsg() or splice() returns
zero, and these readers take zero as EOF, which is the bug the
series fixes. That bound belongs only in tls_sw_read_sock(),
whose callers never return to userspace. The per-call rcvtimeo
restart predates this series and applies to non-empty records too.

-- 
Chuck Lever (Come to NFS bake-a-thon! https://nfsv4bat.org)

Reply via email to