diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-09-26 20:11:52 +0200 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-11-06 18:59:39 +0100 |
commit | a10c4c5e01bdab617eaf3aaac9a96c22ddefa97e (patch) | |
tree | 1aeed61667a9430a3a93262e4ebb62e09454621e /io_uring/xattr.c | |
parent | fs: rename struct xattr_ctx to kernel_xattr_ctx (diff) | |
download | linux-a10c4c5e01bdab617eaf3aaac9a96c22ddefa97e.tar.xz linux-a10c4c5e01bdab617eaf3aaac9a96c22ddefa97e.zip |
new helper: import_xattr_name()
common logics for marshalling xattr names.
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'io_uring/xattr.c')
-rw-r--r-- | io_uring/xattr.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/io_uring/xattr.c b/io_uring/xattr.c index f440121c3984..0b3b871eaa65 100644 --- a/io_uring/xattr.c +++ b/io_uring/xattr.c @@ -62,11 +62,8 @@ static int __io_getxattr_prep(struct io_kiocb *req, if (!ix->ctx.kname) return -ENOMEM; - ret = strncpy_from_user(ix->ctx.kname->name, name, - sizeof(ix->ctx.kname->name)); - if (!ret || ret == sizeof(ix->ctx.kname->name)) - ret = -ERANGE; - if (ret < 0) { + ret = import_xattr_name(ix->ctx.kname, name); + if (ret) { kfree(ix->ctx.kname); return ret; } |