diff options
author | Kevin Brodsky <kevin.brodsky@arm.com> | 2023-04-13 14:47:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-04-14 13:09:27 +0300 |
commit | 60daf8d40b80ccbd593930235aea9ee82ea8dbc2 (patch) | |
tree | 766b0dbf9a6c7cc855c5bdf5b3f43f964885b42b /net/compat.c | |
parent | c39ef2130491b2382f2c81774c825527d4bdf4e2 (diff) | |
download | linux-60daf8d40b80ccbd593930235aea9ee82ea8dbc2.tar.xz |
net/compat: Update msg_control_is_user when setting a kernel pointer
cmsghdr_from_user_compat_to_kern() is an unusual case w.r.t. how
the kmsg->msg_control* fields are used. The input struct msghdr
holds a pointer to a user buffer, i.e. ksmg->msg_control_user is
active. However, upon success, a kernel pointer is stored in
kmsg->msg_control. kmsg->msg_control_is_user should therefore be
updated accordingly.
Cc: Christoph Hellwig <hch@lst.de>
Cc: Eric Dumazet <edumazet@google.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/compat.c')
-rw-r--r-- | net/compat.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/compat.c b/net/compat.c index 000a2e054d4c..6564720f32b7 100644 --- a/net/compat.c +++ b/net/compat.c @@ -211,6 +211,7 @@ int cmsghdr_from_user_compat_to_kern(struct msghdr *kmsg, struct sock *sk, goto Einval; /* Ok, looks like we made it. Hook it up and return success. */ + kmsg->msg_control_is_user = false; kmsg->msg_control = kcmsg_base; kmsg->msg_controllen = kcmlen; return 0; |