TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Dirty Pipe Explained

78 pointsby gtziabout 3 years ago

4 comments

max_kabout 3 years ago
&gt; pipe flag “PIPE_BUF_FLAG_CAN_MERGE”, which signifies that the data buffer inside the pipe can be merged, i.e, this flag notifies the kernel that the changes which are written to the page cache pointed to by the pipe shall be written back to the file<p>That&#x27;s not what this flag does. No pipe flag can ever cause writing dirty pages back to disk, because pipes have by definition nothing to do with files.<p>The CAN_MERGE flag tells the kernel that the next write() to the pipe can append data to this pipe buffer until it&#x27;s full, instead of creating a new pipe buffer for every write().
kccqzyabout 3 years ago
I stopped reading when it starts explaining what&#x27;s memory management.<p>In contrast I found the explanation written by the original author an engaging read: <a href="https:&#x2F;&#x2F;dirtypipe.cm4all.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;dirtypipe.cm4all.com&#x2F;</a>
评论 #30929106 未加载
评论 #30932397 未加载
评论 #30928976 未加载
cyberge99about 3 years ago
I never knew that the standard command pipe is an “anonymous pipe”, but now “named pipes” make more sense.
评论 #30929197 未加载
staticassertionabout 3 years ago
I guess hardware RWX permissions on disks would be useful for this sort of thing.
评论 #30931783 未加载
评论 #30942195 未加载