aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/net/scm.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2023-11-30 13:49:10 +0100
committerChristian Brauner <brauner@kernel.org>2023-12-12 14:24:14 +0100
commiteac9189c96196574a83a553ca5a7543dd9f5fe3e (patch)
treec85c66f053f75a511febc04d949b9bbe7f27620e /include/net/scm.h
parentfs: replace f_rcuhead with f_task_work (diff)
downloadwireguard-linux-eac9189c96196574a83a553ca5a7543dd9f5fe3e.tar.xz
wireguard-linux-eac9189c96196574a83a553ca5a7543dd9f5fe3e.zip
file: stop exposing receive_fd_user()
Not every subsystem needs to have their own specialized helper. Just us the __receive_fd() helper. Link: https://lore.kernel.org/r/20231130-vfs-files-fixes-v1-4-e73ca6f4ea83@kernel.org Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/net/scm.h')
-rw-r--r--include/net/scm.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/net/scm.h b/include/net/scm.h
index e8c76b4be2fe..8aae2468bae0 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -5,6 +5,7 @@
#include <linux/limits.h>
#include <linux/net.h>
#include <linux/cred.h>
+#include <linux/file.h>
#include <linux/security.h>
#include <linux/pid.h>
#include <linux/nsproxy.h>
@@ -208,5 +209,13 @@ static inline void scm_recv_unix(struct socket *sock, struct msghdr *msg,
scm_destroy_cred(scm);
}
+static inline int scm_recv_one_fd(struct file *f, int __user *ufd,
+ unsigned int flags)
+{
+ if (!ufd)
+ return -EFAULT;
+ return __receive_fd(f, ufd, flags);
+}
+
#endif /* __LINUX_NET_SCM_H */