summaryrefslogtreecommitdiffstats
path: root/net/socket.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2023-02-17 12:06:39 +0100
committerDavid S. Miller <davem@davemloft.net>2023-02-17 12:06:39 +0100
commit675f176b4dcc2b75adbcea7ba0e9a649527f53bd (patch)
treedc5eea870c19b405bb6558964e5367bb6c9205c5 /net/socket.c
parentMerge branch 'mlx5-next' of https://git.kernel.org/pub/scm/linux/kernel/git/m... (diff)
parentMerge tag 'drm-fixes-2023-02-17' of git://anongit.freedesktop.org/drm/drm (diff)
downloadlinux-675f176b4dcc2b75adbcea7ba0e9a649527f53bd.tar.xz
linux-675f176b4dcc2b75adbcea7ba0e9a649527f53bd.zip
Merge ra.kernel.org:/pub/scm/linux/kernel/git/netdev/net
Some of the devlink bits were tricky, but I think I got it right. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/socket.c')
-rw-r--r--net/socket.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/net/socket.c b/net/socket.c
index 77626e4d9690..4080b4ba7daf 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -982,9 +982,12 @@ static inline void sock_recv_drops(struct msghdr *msg, struct sock *sk,
static void sock_recv_mark(struct msghdr *msg, struct sock *sk,
struct sk_buff *skb)
{
- if (sock_flag(sk, SOCK_RCVMARK) && skb)
- put_cmsg(msg, SOL_SOCKET, SO_MARK, sizeof(__u32),
- &skb->mark);
+ if (sock_flag(sk, SOCK_RCVMARK) && skb) {
+ /* We must use a bounce buffer for CONFIG_HARDENED_USERCOPY=y */
+ __u32 mark = skb->mark;
+
+ put_cmsg(msg, SOL_SOCKET, SO_MARK, sizeof(__u32), &mark);
+ }
}
void __sock_recv_cmsgs(struct msghdr *msg, struct sock *sk,