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: <x49io59lt4g.fsf@segfault.boston.devel.redhat.com>
Date:	Tue, 10 Nov 2015 11:24:47 -0500
From:	Jeff Moyer <jmoyer@...hat.com>
To:	Jerry Hoemann <jerry.hoemann@....com>
Cc:	ross.zwisler@...ux.intel.com, rjw@...ysocki.net, lenb@...nel.org,
	dan.j.williams@...el.com, linux-acpi@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-nvdimm@...1.01.org
Subject: Re: [PATCH 3/4] nvdimm: Add IOCTL pass thru

Jerry Hoemann <jerry.hoemann@....com> writes:

> @@ -633,10 +718,11 @@ static int match_dimm(struct device *dev, void *data)
>  
>  static long nvdimm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
>  {
> -	int rc = -ENXIO, read_only;
> +	int rc = -ENXIO, ro;
>  	struct nvdimm_bus *nvdimm_bus;
> +	unsigned int type = _IOC_TYPE(cmd);
>  
> -	read_only = (O_RDWR != (file->f_flags & O_ACCMODE));
> +	ro = (O_RDWR != (file->f_flags & O_ACCMODE));

I'm still reviewing the rest of this, but this is bugging me.  The
existing check for read_only looks pretty fishy to me.  O_WRONLY is a
thing (even though it's probably not a supportable mode for this ioctl).
Why not just check for O_RDONLY?

Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ