Commit dec7f062 authored by François LEGAL's avatar François LEGAL Committed by Jan Kiszka

rtnet: tcp: Remove duplicate copy_from/to_user

The RTNET sendmsg/recvmsg protocol handlers used to call
copy_to/from_user on the struct user_msghdr argument. The syscall entry
code already does this copy, so calling again the copy_to/from_user in
handlers triggers SPECTRE mitigation protection on ARM. This patch
removes the calls in the handlers.

This patch has not been tested
Signed-off-by: default avatarFrançois LEGAL <devel@thom.fr.eu.org>
[Jan: massage commit log]
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 25a53f5c
Pipeline #5590 passed with stage
in 30 minutes and 48 seconds
......@@ -2137,7 +2137,6 @@ static ssize_t rt_tcp_recvmsg(struct rtdm_fd *fd, struct user_msghdr *msg,
int msg_flags)
{
struct iovec iov_fast[RTDM_IOV_FASTMAX], *iov;
struct user_msghdr _msg;
ssize_t ret;
size_t len;
void *buf;
......@@ -2145,10 +2144,6 @@ static ssize_t rt_tcp_recvmsg(struct rtdm_fd *fd, struct user_msghdr *msg,
if (msg_flags)
return -EOPNOTSUPP;
msg = rtnet_get_arg(fd, &_msg, msg, sizeof(*msg));
if (IS_ERR(msg))
return PTR_ERR(msg);
/* loop over all vectors to be implemented */
if (msg->msg_iovlen != 1)
return -EOPNOTSUPP;
......@@ -2175,17 +2170,12 @@ static ssize_t rt_tcp_sendmsg(struct rtdm_fd *fd, const struct user_msghdr *msg,
int msg_flags)
{
struct iovec iov_fast[RTDM_IOV_FASTMAX], *iov;
struct user_msghdr _msg;
ssize_t ret;
size_t len;
if (msg_flags)
return -EOPNOTSUPP;
msg = rtnet_get_arg(fd, &_msg, msg, sizeof(*msg));
if (IS_ERR(msg))
return PTR_ERR(msg);
/* loop over all vectors to be implemented */
if (msg->msg_iovlen != 1)
return -EOPNOTSUPP;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment