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]
Message-ID: <bde08554b8939de962a88068bb132ab320f8f7a5.camel@wdc.com>
Date:   Mon, 4 Jun 2018 08:33:46 +0000
From:   Bart Van Assche <Bart.VanAssche@....com>
To:     "jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "evgreen@...omium.org" <evgreen@...omium.org>,
        "vinholikatti@...il.com" <vinholikatti@...il.com>,
        Stanislav Nijnikov <Stanislav.Nijnikov@....com>
CC:     "gwendal@...omium.org" <gwendal@...omium.org>
Subject: Re: [PATCH 3/7] scsi: ufs: Make sysfs attributes writable

On Tue, 2018-05-29 at 11:17 -0700, Evan Green wrote:
> +static ssize_t _name##_store(struct device *dev,			\
> +		struct device_attribute *attr, const char *buf,		\
> +		size_t count)						\
> +{									\
> +	struct ufs_hba *hba = dev_get_drvdata(dev);			\
> +	unsigned long value;						\
> +	if (kstrtoul(buf, 0, &value))					\
> +		return -EINVAL;						\
> +	if (ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,	\
> +		QUERY_ATTR_IDN##_uname, 0, 0, (u32 *)&value))		\
> +		return -EINVAL;						\
> +	return count;							\
> +}									\

Casting an "unsigned long" pointer into an u32 pointer looks evil to me.
Please don't do this.

Thanks,

Bart.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ