Skip to contentSkip to conversation

io_uring: add missing sigmask restore in io_cqring_wait()

PATCH In review Xiaoguang Wang 2 participants 4 messages Sep 14, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: add missing sigmask restore in io_cqring_wait()

Found this by learning codes.

---
 fs/io_uring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/io_uring.c +3 -1
index 30d959416eba..d7b0aeda1d84 100644
@@ -7326,8 +7326,10 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events,
 	if (uts) {
 		struct timespec64 ts;
 
-		if (get_timespec64(&ts, uts))
+		if (get_timespec64(&ts, uts)) {
+			restore_saved_sigmask_unless(false);
 			return -EFAULT;
+		}
 		timeout = timespec64_to_jiffies(&ts);
 	}
 
Signature · 1 line
2.14.4.44.g2045bb6
maintainer
#1 lore raw
Quoted 1 line · Xiaoguang Wang

Found this by learning codes.

Does look like a real bug. But how about we move the get_timespec() section before the sigmask saving?

Signature · 1 line
Jens Axboe
#2 lore raw

hi,

Quoted 4 lines · Xiaoguang Wang
Quoted 1 line

Found this by learning codes.

Does look like a real bug. But how about we move the get_timespec() section before the sigmask saving?

Ok,  I thought about this method before :)

Regards,

Xiaoguang Wang

Quoted 1 line
maintainer
#3 lore raw
Quoted 9 lines · Xiaoguang Wang

hi,

Quoted 4 lines · Xiaoguang Wang
Quoted 1 line

Found this by learning codes.

Does look like a real bug. But how about we move the get_timespec() section before the sigmask saving?

Ok,  I thought about this method before :)

When you send a v2 with that, please do also write a proper commit message. It should explain why the change is needed. Thanks!

Signature · 1 line
Jens Axboe