Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'io_uring-5.10-2020-12-11' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
"Two fixes in here, fixing issues introduced in this merge window"

* tag 'io_uring-5.10-2020-12-11' of git://git.kernel.dk/linux-block:
io_uring: fix file leak on error path of io ctx creation
io_uring: fix mis-seting personality's creds

+11 -8
+11 -8
fs/io_uring.c
··· 1284 1284 */ 1285 1285 io_init_identity(id); 1286 1286 if (creds) 1287 - req->work.identity->creds = creds; 1287 + id->creds = creds; 1288 1288 1289 1289 /* add one for this request */ 1290 1290 refcount_inc(&id->count); ··· 9183 9183 { 9184 9184 struct file *file; 9185 9185 int ret; 9186 + int fd; 9186 9187 9187 9188 #if defined(CONFIG_UNIX) 9188 9189 ret = sock_create_kern(&init_net, PF_UNIX, SOCK_RAW, IPPROTO_IP, ··· 9195 9194 ret = get_unused_fd_flags(O_RDWR | O_CLOEXEC); 9196 9195 if (ret < 0) 9197 9196 goto err; 9197 + fd = ret; 9198 9198 9199 9199 file = anon_inode_getfile("[io_uring]", &io_uring_fops, ctx, 9200 9200 O_RDWR | O_CLOEXEC); 9201 9201 if (IS_ERR(file)) { 9202 - err_fd: 9203 - put_unused_fd(ret); 9202 + put_unused_fd(fd); 9204 9203 ret = PTR_ERR(file); 9205 9204 goto err; 9206 9205 } ··· 9208 9207 #if defined(CONFIG_UNIX) 9209 9208 ctx->ring_sock->file = file; 9210 9209 #endif 9211 - if (unlikely(io_uring_add_task_file(ctx, file))) { 9212 - file = ERR_PTR(-ENOMEM); 9213 - goto err_fd; 9210 + ret = io_uring_add_task_file(ctx, file); 9211 + if (ret) { 9212 + fput(file); 9213 + put_unused_fd(fd); 9214 + goto err; 9214 9215 } 9215 - fd_install(ret, file); 9216 - return ret; 9216 + fd_install(fd, file); 9217 + return fd; 9217 9218 err: 9218 9219 #if defined(CONFIG_UNIX) 9219 9220 sock_release(ctx->ring_sock);