mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
net: remove cmsg restriction from io_uring based send/recvmsg calls
No need to restrict these anymore, as the worker threads are direct clones of the original task. Hence we know for a fact that we can support anything that the regular task can. Since the only user of proto_ops->flags was to flag PROTO_CMSG_DATA_ONLY, kill the member and the flag definition too. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
2587890b5e
commit
e54937963f
@ -42,8 +42,6 @@ struct net;
|
|||||||
#define SOCK_PASSCRED 3
|
#define SOCK_PASSCRED 3
|
||||||
#define SOCK_PASSSEC 4
|
#define SOCK_PASSSEC 4
|
||||||
|
|
||||||
#define PROTO_CMSG_DATA_ONLY 0x0001
|
|
||||||
|
|
||||||
#ifndef ARCH_HAS_SOCKET_TYPES
|
#ifndef ARCH_HAS_SOCKET_TYPES
|
||||||
/**
|
/**
|
||||||
* enum sock_type - Socket types
|
* enum sock_type - Socket types
|
||||||
@ -138,7 +136,6 @@ typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
|
|||||||
|
|
||||||
struct proto_ops {
|
struct proto_ops {
|
||||||
int family;
|
int family;
|
||||||
unsigned int flags;
|
|
||||||
struct module *owner;
|
struct module *owner;
|
||||||
int (*release) (struct socket *sock);
|
int (*release) (struct socket *sock);
|
||||||
int (*bind) (struct socket *sock,
|
int (*bind) (struct socket *sock,
|
||||||
|
@ -1021,7 +1021,6 @@ static int inet_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned lon
|
|||||||
|
|
||||||
const struct proto_ops inet_stream_ops = {
|
const struct proto_ops inet_stream_ops = {
|
||||||
.family = PF_INET,
|
.family = PF_INET,
|
||||||
.flags = PROTO_CMSG_DATA_ONLY,
|
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.release = inet_release,
|
.release = inet_release,
|
||||||
.bind = inet_bind,
|
.bind = inet_bind,
|
||||||
|
@ -665,7 +665,6 @@ int inet6_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
|
|||||||
|
|
||||||
const struct proto_ops inet6_stream_ops = {
|
const struct proto_ops inet6_stream_ops = {
|
||||||
.family = PF_INET6,
|
.family = PF_INET6,
|
||||||
.flags = PROTO_CMSG_DATA_ONLY,
|
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.release = inet6_release,
|
.release = inet6_release,
|
||||||
.bind = inet6_bind,
|
.bind = inet6_bind,
|
||||||
|
10
net/socket.c
10
net/socket.c
@ -2411,10 +2411,6 @@ static int ___sys_sendmsg(struct socket *sock, struct user_msghdr __user *msg,
|
|||||||
long __sys_sendmsg_sock(struct socket *sock, struct msghdr *msg,
|
long __sys_sendmsg_sock(struct socket *sock, struct msghdr *msg,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
/* disallow ancillary data requests from this path */
|
|
||||||
if (msg->msg_control || msg->msg_controllen)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return ____sys_sendmsg(sock, msg, flags, NULL, 0);
|
return ____sys_sendmsg(sock, msg, flags, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2623,12 +2619,6 @@ long __sys_recvmsg_sock(struct socket *sock, struct msghdr *msg,
|
|||||||
struct user_msghdr __user *umsg,
|
struct user_msghdr __user *umsg,
|
||||||
struct sockaddr __user *uaddr, unsigned int flags)
|
struct sockaddr __user *uaddr, unsigned int flags)
|
||||||
{
|
{
|
||||||
if (msg->msg_control || msg->msg_controllen) {
|
|
||||||
/* disallow ancillary data reqs unless cmsg is plain data */
|
|
||||||
if (!(sock->ops->flags & PROTO_CMSG_DATA_ONLY))
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ____sys_recvmsg(sock, msg, umsg, uaddr, flags, 0);
|
return ____sys_recvmsg(sock, msg, umsg, uaddr, flags, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user