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] [day] [month] [year] [list]
Message-ID: <20220612094842.00ffc23b@jic23-huawei>
Date:   Sun, 12 Jun 2022 09:49:23 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Paul Cercueil <paul@...pouillou.net>
Cc:     Lars-Peter Clausen <lars@...afoo.de>, linux-iio@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Eugen Hristev <eugen.hristev@...rochip.com>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Ludovic Desroches <ludovic.desroches@...rochip.com>
Subject: Re: [PATCH 2/2] iio: at91-sama5d2: Limit requested watermark value
 to hwfifo size

On Sat, 04 Jun 2022 23:41:02 +0100
Paul Cercueil <paul@...pouillou.net> wrote:

> Hi Jonathan,
> 
> Le sam., juin 4 2022 at 16:05:57 +0100, Jonathan Cameron 
> <jic23@...nel.org> a écrit :
> > On Sat, 22 Jan 2022 17:04:47 +0000
> > Jonathan Cameron <jic23@...nel.org> wrote:
> >   
> >>  On Mon, 17 Jan 2022 10:25:12 +0000
> >>  Paul Cercueil <paul@...pouillou.net> wrote:
> >>   
> >>  > Instead of returning an error if the watermark value is too high,   
> >> which  
> >>  > the core will silently ignore anyway, limit the value to the   
> >> hardware  
> >>  > FIFO size; a lower-than-requested value is still better than   
> >> using the  
> >>  > default, which is usually 1.  
> >> 
> >>  There is another potential error condition in this function which 
> >> will
> >>  also be ignored by the core.
> >> 
> >>  As such whilst I agree this is a sensible thing to do in this
> >>  particular case I think we should also be handling the error in the 
> >> core.
> >> 
> >>  I think it would be better to clean that up at the same time
> >>  as these improvements - particularly as I'd guess you have a 
> >> convenient
> >>  test setup to check the error unwind is correct?  
> > 
> > Hi Paul,
> > 
> > I was trawling through patchwork and realised this one is stalled.
> > 
> > Thoughts on the above?  
> 
> Totally forgot about this patch.
> 
> Aren't you afraid that if we start handling these errors in the core, 
> we'll somehow break the ABI?
> 
Been a while, but I think my concern was more that there are other
error conditions in these calls.  Whilst we can indeed clamp the
watermark, the other conditions should probably be handled in the core.

I guess that doesn't mean i shouldn't take these in the meantime, just
that there is more work to do here and I was sneakily trying to make
it your problem *evil laugh*

As such, applied these two to, but if anyone has time to take a look
at handling the error returns in the core that would be great.

Applied to the togreg branch of iio.git and I'll push out as testing
later (on train with dodgy wifi) for 0-day to take a look.

Thanks,

Jonathan

> -Paul
> 
> > Thanks,
> > 
> > Jonathan
> >   
> >> 
> >>  Thanks,
> >> 
> >>  Jonathan
> >>   
> >>  >
> >>  > Cc: Eugen Hristev <eugen.hristev@...rochip.com>
> >>  > Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>
> >>  > Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>
> >>  > Cc: Ludovic Desroches <ludovic.desroches@...rochip.com>
> >>  > Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> >>  > ---
> >>  >  drivers/iio/adc/at91-sama5d2_adc.c | 2 +-
> >>  >  1 file changed, 1 insertion(+), 1 deletion(-)
> >>  >
> >>  > diff --git a/drivers/iio/adc/at91-sama5d2_adc.c   
> >> b/drivers/iio/adc/at91-sama5d2_adc.c  
> >>  > index 854b1f81d807..5cc84f4a17bb 100644
> >>  > --- a/drivers/iio/adc/at91-sama5d2_adc.c
> >>  > +++ b/drivers/iio/adc/at91-sama5d2_adc.c
> >>  > @@ -1752,7 +1752,7 @@ static int at91_adc_set_watermark(struct   
> >> iio_dev *indio_dev, unsigned int val)  
> >>  >  	int ret;
> >>  >
> >>  >  	if (val > AT91_HWFIFO_MAX_SIZE)
> >>  > -		return -EINVAL;
> >>  > +		val = AT91_HWFIFO_MAX_SIZE;
> >>  >
> >>  >  	if (!st->selected_trig->hw_trig) {
> >>  >  		dev_dbg(&indio_dev->dev, "we need hw trigger for DMA\n");  
> >>   
> >   
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ