HomeFreeBSD

Historically when an application wrote an entire block of a file,
rS231313Unpublished

Unpublished Commit ยท Learn More

No further details are available.

Description

Historically when an application wrote an entire block of a file,
the kernel allocated a buffer but did not zero it as it was about
to be completely filled by a uiomove() from the user's buffer.
However, if the uiomove() failed, the old contents of the buffer
could be exposed especially if the file was being mmap'ed. The
fix was to always zero the buffer when it was allocated.

This change first attempts the uiomove() to the newly allocated
(and dirty) buffer and only zeros it if the uiomove() fails. The
effect is to eliminate the gratuitous zeroing of the buffer in
the usual case where the uiomove() successfully fills it.

Reviewed by: kib
Tested by: scottl
MFC after: 2 weeks (to 9 only)

Details

Provenance
mckusickAuthored on
Parents
rS231312: - Emulate RDHWR instruction for TLS support
Branches
Unknown
Tags
Unknown

Event Timeline