Skip to content
Permalink
Browse files
udp:allow UDP cmsghdrs through io_uring
Signed-off-by: Victor Stewart <v@nametag.social>
  • Loading branch information
victorstewart authored and intel-lab-lkp committed Dec 16, 2020
1 parent 3db1a3f commit 6cce2a0155c3ee2a1550cb3d5e434cc85f055a60
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
@@ -1052,6 +1052,7 @@ EXPORT_SYMBOL(inet_stream_ops);

const struct proto_ops inet_dgram_ops = {
.family = PF_INET,
.flags = PROTO_CMSG_DATA_ONLY,
.owner = THIS_MODULE,
.release = inet_release,
.bind = inet_bind,
@@ -695,6 +695,7 @@ const struct proto_ops inet6_stream_ops = {

const struct proto_ops inet6_dgram_ops = {
.family = PF_INET6,
.flags = PROTO_CMSG_DATA_ONLY,
.owner = THIS_MODULE,
.release = inet6_release,
.bind = inet6_bind,
@@ -2399,9 +2399,11 @@ static int ___sys_sendmsg(struct socket *sock, struct user_msghdr __user *msg,
long __sys_sendmsg_sock(struct socket *sock, struct msghdr *msg,
unsigned int flags)
{
/* disallow ancillary data requests from this path */
if (msg->msg_control || msg->msg_controllen)
return -EINVAL;
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_sendmsg(sock, msg, flags, NULL, 0);
}

0 comments on commit 6cce2a0

Please sign in to comment.