Re: [PATCH] proc: Use seq_read_iter where possible

From: Christoph Hellwig
Date: Wed Apr 28 2021 - 02:13:04 EST


On Tue, Apr 27, 2021 at 08:34:15PM +0200, Arkadiusz Kozdra (Arusekk) wrote:
> Since seq_read_iter looks mature enough to be used for all procfs files,
> re-allow applications to perform zero-copy data forwarding from them.
> According to the sendfile(2) man-page, it is still enough for the file
> being read to support mmap-like operations, and the proc files support
> memory mapping, so returning -EINVAL was an inconsistency.

Linus did object to blindly switching over all instances.

> Some executable-inspecting tools rely on patching entry point
> instructions with minimal machine code that uses sendfile to read
> /proc/self/maps to stdout. The sendfile call allows them to do it
> faster and without excessive allocations.

Patching what entry point?