fstests: test dirty pipe vulnerability issue of CVE-2022-0847
authorZorro Lang <zlang@redhat.com>
Mon, 11 Apr 2022 16:37:10 +0000 (00:37 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 17 Apr 2022 11:56:22 +0000 (19:56 +0800)
commit0b11a5ecb8e5ca8c2a9a5aa59c493a2d9fd485f8
tree9f5040ec8452d616ca77594d753bf00792e506b8
parentdaa0c0146c7db84d1e368fcfcc8751566695b590
fstests: test dirty pipe vulnerability issue of CVE-2022-0847

Test for the Dirty Pipe vulnerability (CVE-2022-0847) caused by an
uninitialized  "pipe_buffer.flags" variable. The bug cause a file
can be overwritten even if a user/process is not permitted to write
it. It's fixed by 9d2231c5d74e ("lib/iov_iter: initialize "flags" in
new pipe_buffer").

Cc: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
.gitignore
src/Makefile
src/splice2pipe.c [new file with mode: 0644]
tests/generic/680 [new file with mode: 0755]
tests/generic/680.out [new file with mode: 0644]