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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 19 Aug 2019 13:34:17 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Zhao Yakui <yakui.zhao@...el.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        devel@...verdev.osuosl.org, Jason Chen CJ <jason.cj.chen@...el.com>
Subject: Re: [RFC PATCH 15/15] drivers/acrn: add the support of offline SOS
 cpu

On Fri, Aug 16, 2019 at 10:25:56AM +0800, Zhao Yakui wrote:
> diff --git a/drivers/staging/acrn/acrn_dev.c b/drivers/staging/acrn/acrn_dev.c
> index 0602125..6868003 100644
> --- a/drivers/staging/acrn/acrn_dev.c
> +++ b/drivers/staging/acrn/acrn_dev.c
> @@ -588,6 +588,41 @@ static const struct file_operations fops = {
>  #define SUPPORT_HV_API_VERSION_MAJOR	1
>  #define SUPPORT_HV_API_VERSION_MINOR	0
>  
> +static ssize_t
> +offline_cpu_store(struct device *dev,
> +			struct device_attribute *attr,
> +			const char *buf, size_t count)
> +{
> +#ifdef CONFIG_X86
> +	u64 cpu, lapicid;
> +
> +	if (kstrtoull(buf, 0, &cpu) < 0)
> +		return -EINVAL;

Preserve the error code.

	ret = kstrtoull(buf, 0, &cpu);
	if (ret)
		return ret;

> +
> +	if (cpu_possible(cpu)) {

You can't pass unchecked cpu values to cpu_possible() or it results in
an out of bounds read if cpu is >= than nr_cpu_ids.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ