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: <ae71f8d6acac42f7e85fd111259e578305e938ed.camel@siemens.com>
Date:   Wed, 30 Nov 2022 15:43:27 +0000
From:   "Sverdlin, Alexander" <alexander.sverdlin@...mens.com>
To:     "broonie@...nel.org" <broonie@...nel.org>
CC:     "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
        "lukas@...ner.de" <lukas@...ner.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>
Subject: Re: [PATCH] spi: spidev: mask SPI_CS_HIGH in SPI_IOC_RD_MODE

Hello Mark,

On Wed, 2022-11-30 at 14:57 +0000, Mark Brown wrote:
> >   	/* read requests */
> >   	case SPI_IOC_RD_MODE:
> > -		retval = put_user(spi->mode & SPI_MODE_MASK,
> > -					(__u8 __user *)arg);
> > +		tmp = spi->mode;
> > +
> > +		{
> > +			struct spi_controller *ctlr = spi-
> > >controller;
> > +
> > +			if (ctlr->use_gpio_descriptors && ctlr-
> > >cs_gpiods &&
> > +			    ctlr->cs_gpiods[spi->chip_select])
> > +				tmp &= ~SPI_CS_HIGH;
> > +		}
> > +
> > +		retval = put_user(tmp & SPI_MODE_MASK, (__u8
> > __user *)arg);
> >   		break;
> >   	case SPI_IOC_RD_MODE32:
> >   		retval = put_user(spi->mode & SPI_MODE_MASK,
> 
> What about SPI_IOC_RD_MODE_32?  On the write path the code is
> shared...

you are right, thanks for this hint!
I'll re-send if there are no objections to this approach in general.

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ