Re: [PATCH v2 1/3] fs: add ksys_lsetxattr() wrapper

From
Jann Horn <jannh@google.com>
Date
2019-05-10 21:28:41
Also in
linux-fsdevel, linux-integrity, linux-security-module, lkml
Reply to
Roberto Sassu, 2019-05-09
On Thu, May 09, 2019 at 01:24:18PM +0200, Roberto Sassu wrote:
Similarly to commit 03450e271a16 ("fs: add ksys_fchmod() and do_fchmodat()
helpers and ksys_chmod() wrapper; remove in-kernel calls to syscall"), this
patch introduces the ksys_lsetxattr() helper to avoid in-kernel calls to
the sys_lsetxattr() syscall.

Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
[...]
quoted hunk ↗ jump to hunk
+int ksys_lsetxattr(const char __user *pathname,
+		   const char __user *name, const void __user *value,
+		   size_t size, int flags)
+{
+	return path_setxattr(pathname, name, value, size, flags, 0);
+}
Instead of exposing ksys_lsetxattr(), wouldn't it be cleaner to use
kern_path() and vfs_setxattr(), or something like that? Otherwise you're
adding more code that has to cast between kernel and user pointers.
Thread (54 messages) 54 messages, 11 authors, last reply 2019-05-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help