public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: add missing sigmask restore in io_cqring_wait()
@ 2021-09-14  8:41 Xiaoguang Wang
  2021-09-14 13:42 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaoguang Wang @ 2021-09-14  8:41 UTC (permalink / raw)
  To: io-uring; +Cc: axboe, asml.silence, Xiaoguang Wang

Found this by learning codes.

Signed-off-by: Xiaoguang Wang <[email protected]>
---
 fs/io_uring.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 30d959416eba..d7b0aeda1d84 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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);
 	}
 
-- 
2.14.4.44.g2045bb6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] io_uring: add missing sigmask restore in io_cqring_wait()
  2021-09-14  8:41 [PATCH] io_uring: add missing sigmask restore in io_cqring_wait() Xiaoguang Wang
@ 2021-09-14 13:42 ` Jens Axboe
  2021-09-14 14:28   ` Xiaoguang Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-09-14 13:42 UTC (permalink / raw)
  To: Xiaoguang Wang, io-uring; +Cc: asml.silence

On 9/14/21 2:41 AM, Xiaoguang Wang wrote:
> Found this by learning codes.

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

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] io_uring: add missing sigmask restore in io_cqring_wait()
  2021-09-14 13:42 ` Jens Axboe
@ 2021-09-14 14:28   ` Xiaoguang Wang
  2021-09-14 14:29     ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Xiaoguang Wang @ 2021-09-14 14:28 UTC (permalink / raw)
  To: Jens Axboe, io-uring; +Cc: asml.silence

hi,


> On 9/14/21 2:41 AM, Xiaoguang Wang wrote:
>> 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

>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] io_uring: add missing sigmask restore in io_cqring_wait()
  2021-09-14 14:28   ` Xiaoguang Wang
@ 2021-09-14 14:29     ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-09-14 14:29 UTC (permalink / raw)
  To: Xiaoguang Wang, io-uring; +Cc: asml.silence

On 9/14/21 8:28 AM, Xiaoguang Wang wrote:
> hi,
> 
> 
>> On 9/14/21 2:41 AM, Xiaoguang Wang wrote:
>>> 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!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-14 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-14  8:41 [PATCH] io_uring: add missing sigmask restore in io_cqring_wait() Xiaoguang Wang
2021-09-14 13:42 ` Jens Axboe
2021-09-14 14:28   ` Xiaoguang Wang
2021-09-14 14:29     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox