]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
lift compat definitions of mcast [sg]etsockopt requests into net/compat.h
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 10 May 2020 00:58:17 +0000 (20:58 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 May 2020 00:31:25 +0000 (20:31 -0400)
We want to get rid of compat_mc_[sg]etsockopt() and to have that stuff
handled without compat_alloc_user_space(), extra copying through
userland, etc.  To do that we'll need ipv4 and ipv6 instances of
->compat_[sg]etsockopt() to manipulate the 32bit variants of mcast
requests, so we need to move the definitions of those out of net/compat.c
and into a public header.

This patch just does a mechanical move to include/net/compat.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
include/net/compat.h
net/compat.c

index 2b5e1f7ba153366e628e45ec73f31a63d511ce27..69a8cd29c0ae72f83e4b75a4f70a909339837a4d 100644 (file)
@@ -74,4 +74,28 @@ int compat_mc_getsockopt(struct sock *, int, int, char __user *, int __user *,
                         int (*)(struct sock *, int, int, char __user *,
                                 int __user *));
 
+struct compat_group_req {
+       __u32                            gr_interface;
+       struct __kernel_sockaddr_storage gr_group
+               __aligned(4);
+} __packed;
+
+struct compat_group_source_req {
+       __u32                            gsr_interface;
+       struct __kernel_sockaddr_storage gsr_group
+               __aligned(4);
+       struct __kernel_sockaddr_storage gsr_source
+               __aligned(4);
+} __packed;
+
+struct compat_group_filter {
+       __u32                            gf_interface;
+       struct __kernel_sockaddr_storage gf_group
+               __aligned(4);
+       __u32                            gf_fmode;
+       __u32                            gf_numsrc;
+       struct __kernel_sockaddr_storage gf_slist[1]
+               __aligned(4);
+} __packed;
+
 #endif /* NET_COMPAT_H */
index 69fc6d1e4e6e9af66f7d394ca1a19a7ce6913bb9..032114de4fecbacb66b116a499107158a0ef5fbc 100644 (file)
@@ -448,34 +448,9 @@ COMPAT_SYSCALL_DEFINE5(getsockopt, int, fd, int, level, int, optname,
        return __compat_sys_getsockopt(fd, level, optname, optval, optlen);
 }
 
-struct compat_group_req {
-       __u32                            gr_interface;
-       struct __kernel_sockaddr_storage gr_group
-               __aligned(4);
-} __packed;
-
-struct compat_group_source_req {
-       __u32                            gsr_interface;
-       struct __kernel_sockaddr_storage gsr_group
-               __aligned(4);
-       struct __kernel_sockaddr_storage gsr_source
-               __aligned(4);
-} __packed;
-
-struct compat_group_filter {
-       __u32                            gf_interface;
-       struct __kernel_sockaddr_storage gf_group
-               __aligned(4);
-       __u32                            gf_fmode;
-       __u32                            gf_numsrc;
-       struct __kernel_sockaddr_storage gf_slist[1]
-               __aligned(4);
-} __packed;
-
 #define __COMPAT_GF0_SIZE (sizeof(struct compat_group_filter) - \
                        sizeof(struct __kernel_sockaddr_storage))
 
-
 int compat_mc_setsockopt(struct sock *sock, int level, int optname,
        char __user *optval, unsigned int optlen,
        int (*setsockopt)(struct sock *, int, int, char __user *, unsigned int))