lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <868405bc-cb04-8bd8-a3db-fb35a2a6beb2@linux.ibm.com>
Date:   Wed, 17 May 2023 18:11:05 +0200
From:   Steffen Eiden <seiden@...ux.ibm.com>
To:     Claudio Imbrenda <imbrenda@...ux.ibm.com>
Cc:     kvm@...r.kernel.org, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Viktor Mihajlovski <mihajlov@...ux.ibm.com>,
        Janosch Frank <frankja@...ux.ibm.com>,
        Nico Boehr <nrb@...ux.ibm.com>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Hendrik Brueckner <brueckner@...ux.ibm.com>
Subject: Re: [PATCH 3/5] s390/uvdevice: Add 'List Secrets' UVC

Thanks for your review.


On 5/17/23 18:03, Claudio Imbrenda wrote:
>> static int uvio_list_secrets(struct uvio_ioctl_cb *uv_ioctl)
>> +{
>> +	void __user *user_buf_arg = (void __user *)uv_ioctl->argument_addr;
>> +	struct uv_cb_guest_addr uvcb = {
>> +		.header.len = sizeof(uvcb),
>> +		.header.cmd = UVC_CMD_LIST_SECRETS,
>> +	};
>> +	void *secrets = NULL;
>> +	int ret;
>> +
>> +	if (uv_ioctl->argument_len != UVIO_LIST_SECRETS_LEN)
>> +		return -EINVAL;
>> +
>> +	secrets = kvzalloc(uv_ioctl->argument_len, GFP_KERNEL);
>> +	if (!secrets)
>> +		return -ENOMEM;
>> +
>> +	uvcb.addr = (u64)secrets;
> I think you need virt_to_phys()
The UV expects a virtual address here.

> 
>> +	uv_call_sched(0, (u64)&uvcb);
>> +	uv_ioctl->uv_rc = uvcb.header.rc;
>> +	uv_ioctl->uv_rrc = uvcb.header.rrc;
>> +
>> +	if (copy_to_user(user_buf_arg, secrets, uv_ioctl->argument_len))
>> +		ret = -EFAULT;
>> +	else
>> +		ret = 0;
>> +
>> +	kvfree(secrets);
>> +	return ret;
>> +}

Steffen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ