[PATCH] Revert "pipe: make pipe writes always wake up readers"

2 views
Skip to first unread message

Tadeusz Struk

unread,
Jun 8, 2022, 7:08:50 PM6/8/22
to syzbot+16342c...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, tadeus...@linaro.org
#syz test: https://android.googlesource.com/kernel/common android12-5.10-lts

This reverts commit 27aa7171fe2b00c3de01e8e3a3298a3639f37fa3.
==================================
diff --git a/fs/pipe.c b/fs/pipe.c
index ea77cf5b519f..0c864618054d 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -445,20 +445,20 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
#endif

/*
- * Epoll nonsensically wants a wakeup whether the pipe
- * was already empty or not.
+ * Only wake up if the pipe started out empty, since
+ * otherwise there should be no readers waiting.
*
* If it wasn't empty we try to merge new data into
* the last buffer.
*
* That naturally merges small writes, but it also
- * page-aligns the rest of the writes for large writes
+ * page-aligs the rest of the writes for large writes
* spanning multiple pages.
*/
head = pipe->head;
- was_empty = true;
+ was_empty = pipe_empty(head, pipe->tail);
chars = total_len & (PAGE_SIZE-1);
- if (chars && !pipe_empty(head, pipe->tail)) {
+ if (chars && !was_empty) {
unsigned int mask = pipe->ring_size - 1;
struct pipe_buffer *buf = &pipe->bufs[(head - 1) & mask];
int offset = buf->offset + buf->len;
--
2.36.1

syzbot

unread,
Jun 8, 2022, 7:31:11 PM6/8/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
no output from test machine



Tested on:

commit: fdd06dc6 ANDROID: GKI: db845c: Update symbols list and..
git tree: android12-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=150a7705f00000
kernel config: https://syzkaller.appspot.com/x/.config?x=89bdb361ba397fca
dashboard link: https://syzkaller.appspot.com/bug?extid=16342c5db3ef64c0f60a
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=13ebf41bf00000

Tadeusz Struk

unread,
Jun 8, 2022, 8:04:57 PM6/8/22
to syzbot+16342c...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, tadeus...@linaro.org

syzbot

unread,
Jun 8, 2022, 8:21:18 PM6/8/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch but the reproducer is still triggering an issue:
no output from test machine



Tested on:

commit: fdd06dc6 ANDROID: GKI: db845c: Update symbols list and..
git tree: android12-5.10-lts
console output: https://syzkaller.appspot.com/x/log.txt?x=1021853bf00000
kernel config: https://syzkaller.appspot.com/x/.config?x=89bdb361ba397fca
dashboard link: https://syzkaller.appspot.com/bug?extid=16342c5db3ef64c0f60a
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=11f93957f00000

Reply all
Reply to author
Forward
0 new messages