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-next>] [day] [month] [year] [list]
Message-ID: <20180108174340.GA7310@avx2>
Date:   Mon, 8 Jan 2018 20:43:40 +0300
From:   Alexey Dobriyan <adobriyan@...il.com>
To:     tim.c.chen@...ux.intel.com, aarcange@...hat.com
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 4/8] x86/spec_ctrl: Add sysctl knobs to enable/disable
 SPEC_CTRL feature

> +	len = sprintf(buf, "%d\n", READ_ONCE(*field));

READ_ONCE isn't necessary as there is only one read being made.

> +	len = min(count, sizeof(buf) - 1);
> +	if (copy_from_user(buf, user_buf, len))
> +		return -EFAULT;
> +
> +	buf[len] = '\0';
> +	if (kstrtouint(buf, 0, &enable))
> +		return -EINVAL;

There is kstrto*_from_user().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ