Dirty Pipe Explained
hackthebox.com
hackthebox.com
That'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.
The CAN_MERGE flag tells the kernel that the next write() to the pipe can append data to this pipe buffer until it's full, instead of creating a new pipe buffer for every write().
In contrast I found the explanation written by the original author an engaging read: https://dirtypipe.cm4all.com/
This part was especially eye-opening:
"... it not only works without write permissions, it also works with immutable files, on read-only btrfs snapshots and on read-only mounts (including CD-ROM mounts)..."
Apple had to do custom stuff in various parts of their stack to make it cheap to flip the W and X flags since they wanted to do it frequently.