Lines 7447-7455
static int io_sq_offload_start(struct io_ring_ctx *ctx,
Link Here
|
7447 |
{ |
7447 |
{ |
7448 |
int ret; |
7448 |
int ret; |
7449 |
|
7449 |
|
7450 |
mmgrab(current->mm); |
|
|
7451 |
ctx->sqo_mm = current->mm; |
7452 |
|
7453 |
if (ctx->flags & IORING_SETUP_SQPOLL) { |
7450 |
if (ctx->flags & IORING_SETUP_SQPOLL) { |
7454 |
ret = -EPERM; |
7451 |
ret = -EPERM; |
7455 |
if (!capable(CAP_SYS_ADMIN)) |
7452 |
if (!capable(CAP_SYS_ADMIN)) |
Lines 7494-7503
static int io_sq_offload_start(struct io_ring_ctx *ctx,
Link Here
|
7494 |
return 0; |
7491 |
return 0; |
7495 |
err: |
7492 |
err: |
7496 |
io_finish_async(ctx); |
7493 |
io_finish_async(ctx); |
7497 |
if (ctx->sqo_mm) { |
|
|
7498 |
mmdrop(ctx->sqo_mm); |
7499 |
ctx->sqo_mm = NULL; |
7500 |
} |
7501 |
return ret; |
7494 |
return ret; |
7502 |
} |
7495 |
} |
7503 |
|
7496 |
|
Lines 8547-8552
static int io_uring_create(unsigned entries, struct io_uring_params *p,
Link Here
|
8547 |
ctx->user = user; |
8540 |
ctx->user = user; |
8548 |
ctx->creds = get_current_cred(); |
8541 |
ctx->creds = get_current_cred(); |
8549 |
|
8542 |
|
|
|
8543 |
mmgrab(current->mm); |
8544 |
ctx->sqo_mm = current->mm; |
8545 |
|
8550 |
/* |
8546 |
/* |
8551 |
* Account memory _before_ installing the file descriptor. Once |
8547 |
* Account memory _before_ installing the file descriptor. Once |
8552 |
* the descriptor is installed, it can get closed at any time. Also |
8548 |
* the descriptor is installed, it can get closed at any time. Also |