Re: IORING_REGISTER_CREDS[_UPDATE]() and credfd_create()?

Stefan Metzmacher
2020-01-30T06:53:50Z

[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]

Hi Jens,

> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index c5ca84a305d3..0b2c7d800297 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -6511,6 +6505,45 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
> return submitted ? submitted : ret;
> }
>
> +struct ring_show_idr {
> + struct io_ring_ctx *ctx;
> + struct seq_file *m;
> +};
> +
> +static int io_uring_show_cred(int id, void *p, void *data)
> +{
> + struct ring_show_idr *r = data;
> + const struct cred *cred = p;
> +
> + seq_printf(r->m, "\t%5d: uid=%u/gid=%u\n", id, cred->uid.val,
> + cred->gid.val);
> + return 0;
> +}

I think we should print similar information as task_state(),
there we have:

Uid: 1000 1000 1000 1000
Gid: 1000 1000 1000 1000
Groups: 1 2 3 4 5 1000

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]