Skip to contentSkip to conversation

FAILED: patch "[PATCH] io_uring: ensure open/openat2 name is cleaned on cancelation" failed to apply to 5.8-stable tree

PATCH [email protected] 3 participants 3 messages Sep 28, 2020

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.8-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From f3cd4850504ff612d0ea77a0aaf29b66c98fcefe Mon Sep 17 00:00:00 2001
From: Jens Axboe <[email protected]>
Date: Thu, 24 Sep 2020 14:55:54 -0600
Subject: [PATCH] io_uring: ensure open/openat2 name is cleaned on cancelation

If we cancel these requests, we'll leak the memory associated with the filename. Add them to the table of ops that need cleaning, if REQ_F_NEED_CLEANUP is set.

Fixes e62753e4e292 ("io_uring: call statx directly")
fs/io_uring.c +5 -0
index e6004b92e553..0ab16df31288 100644
@@ -5671,6 +5671,11 @@ static void __io_clean_op(struct io_kiocb *req)
 			io_put_file(req, req->splice.file_in,
 				    (req->splice.flags & SPLICE_F_FD_IN_FIXED));
 			break;
+		case IORING_OP_OPENAT:
+		case IORING_OP_OPENAT2:
+			if (req->open.filename)
+				putname(req->open.filename);
+			break;
 		}
 		req->flags &= ~REQ_F_NEED_CLEANUP;
 	}
#1 lore raw

Jens, if you want I can do the backport for 5.8.

Stefano

Quoted 43 lines · On Mon, Sep 28, 2020 at 04:04:25PM +0200, [email protected] wrote:

The patch below does not apply to the 5.8-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From f3cd4850504ff612d0ea77a0aaf29b66c98fcefe Mon Sep 17 00:00:00 2001
From: Jens Axboe <[email protected]>
Date: Thu, 24 Sep 2020 14:55:54 -0600
Subject: [PATCH] io_uring: ensure open/openat2 name is cleaned on cancelation

If we cancel these requests, we'll leak the memory associated with the filename. Add them to the table of ops that need cleaning, if REQ_F_NEED_CLEANUP is set.

Fixes e62753e4e292 ("io_uring: call statx directly")
fs/io_uring.c +5 -0
index e6004b92e553..0ab16df31288 100644
@@ -5671,6 +5671,11 @@ static void __io_clean_op(struct io_kiocb *req)
 			io_put_file(req, req->splice.file_in,
 				    (req->splice.flags & SPLICE_F_FD_IN_FIXED));
 			break;
+		case IORING_OP_OPENAT:
+		case IORING_OP_OPENAT2:
+			if (req->open.filename)
+				putname(req->open.filename);
+			break;
 		}
 		req->flags &= ~REQ_F_NEED_CLEANUP;
 	}
#2 lore raw
Quoted 1 line · Stefano Garzarella

Jens, if you want I can do the backport for 5.8.

That'd be great, thanks!

Signature · 1 line
Jens Axboe