From: Laurent Vivier <laurent@vivier.eu>
To: Helge Deller <deller@gmx.de>,
Richard Henderson <richard.henderson@linaro.org>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] linux-user: Implement SOL_ALG encryption support
Date: Tue, 31 Jan 2023 13:09:47 +0100 [thread overview]
Message-ID: <294f40c1-7e4c-abf8-29a2-d20a59a25e35@vivier.eu> (raw)
In-Reply-To: <20221212173416.90590-1-deller@gmx.de>
Le 12/12/2022 à 18:34, Helge Deller a écrit :
> Add suport to handle SOL_ALG packets via sendmsg() and recvmsg().
> This allows emulated userspace to use encryption functionality.
>
> Tested with the debian ell package with hppa guest on x86_64 host.
>
> Signed-off-by: Helge Deller <deller@gmx.de>
> ---
> linux-user/syscall.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 71ae867024..a365903a3a 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1871,6 +1871,14 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
> __get_user(cred->pid, &target_cred->pid);
> __get_user(cred->uid, &target_cred->uid);
> __get_user(cred->gid, &target_cred->gid);
> + } else if (cmsg->cmsg_level == SOL_ALG) {
> + uint32_t *dst = (uint32_t *)data;
> +
> + memcpy(dst, target_data, len);
> + /* fix endianess of first 32-bit word */
> + if (len >= sizeof(uint32_t)) {
> + *dst = tswap32(*dst);
> + }
> } else {
> qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
> cmsg->cmsg_level, cmsg->cmsg_type);
> --
> 2.38.1
>
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
next prev parent reply other threads:[~2023-01-31 12:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 17:34 [PATCH 1/2] linux-user: Implement SOL_ALG encryption support Helge Deller
2022-12-12 17:34 ` [PATCH 2/2] linux-user: Allow sendmsg() without IOV Helge Deller
2023-01-31 12:28 ` Laurent Vivier
2023-01-31 13:34 ` Helge Deller
2023-01-31 13:50 ` Helge Deller
2023-01-31 15:17 ` Laurent Vivier
2023-01-31 15:17 ` Laurent Vivier
2023-01-31 15:19 ` Laurent Vivier
2023-01-31 12:09 ` Laurent Vivier [this message]
2023-01-31 15:19 ` [PATCH 1/2] linux-user: Implement SOL_ALG encryption support Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=294f40c1-7e4c-abf8-29a2-d20a59a25e35@vivier.eu \
--to=laurent@vivier.eu \
--cc=deller@gmx.de \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).