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: <Z6YqCOP2lVseW-i4@thinkpad>
Date: Fri, 7 Feb 2025 10:43:04 -0500
From: Yury Norov <yury.norov@...il.com>
To: David Lechner <dlechner@...libre.com>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Bartosz Golaszewski <brgl@...ev.pl>,
	Andy Shevchenko <andy@...nel.org>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	Lars-Peter Clausen <lars@...afoo.de>,
	Michael Hennerich <Michael.Hennerich@...log.com>,
	Jonathan Cameron <jic23@...nel.org>,
	Ulf Hansson <ulf.hansson@...aro.org>, Peter Rosin <peda@...ntia.se>,
	Andrew Lunn <andrew@...n.ch>,
	Heiner Kallweit <hkallweit1@...il.com>,
	Russell King <linux@...linux.org.uk>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Vinod Koul <vkoul@...nel.org>,
	Kishon Vijay Abraham I <kishon@...nel.org>,
	Nuno Sá <nuno.sa@...log.com>,
	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>, Jaroslav Kysela <perex@...ex.cz>,
	Takashi Iwai <tiwai@...e.com>, linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
	linux-mmc@...r.kernel.org, netdev@...r.kernel.org,
	linux-phy@...ts.infradead.org, linux-sound@...r.kernel.org
Subject: Re: [PATCH v2 04/13] bus: ts-nbus: use gpiod_multi_set_value_cansleep

On Fri, Feb 07, 2025 at 09:23:56AM -0600, David Lechner wrote:
> On 2/7/25 6:17 AM, Andy Shevchenko wrote:
> > +Yury.
> > 
> > On Fri, Feb 7, 2025 at 2:15 PM Andy Shevchenko
> > <andy.shevchenko@...il.com> wrote:
> >> On Fri, Feb 7, 2025 at 12:48 AM David Lechner <dlechner@...libre.com> wrote:
> > 
> > ...
> > 
> >>>  static void ts_nbus_write_byte(struct ts_nbus *ts_nbus, u8 byte)
> >>>  {
> >>> -       struct gpio_descs *gpios = ts_nbus->data;
> >>>         DECLARE_BITMAP(values, 8);
> >>>
> >>>         values[0] = byte;
> >>>
> >>> -       gpiod_set_array_value_cansleep(8, gpios->desc, gpios->info, values);
> >>> +       gpiod_multi_set_value_cansleep(ts_nbus->data, values);
> >>
> >> As I said before, this is buggy code on BE64. Needs to be fixed.
> > 
> > Or isn't? Do we have a test case in bitmap for such a case?
> > 
> >>>  }
> > 
> > 
> 
> Maybe not the best style, but I don't think it is buggy. Bitmaps are always
> handled in long-sized chunks and not cast to bytes so endianness doesn't affect
> it. I didn't see an explicit test, but bitmap_read() and bitmap_write() use
> array access like this so indirectly it is being tested.

Not a bug, but direct addressing to bitmap elements is discouraged.
I'd suggest using bitmap_write(values, byte, 0, 8) instead.

Thanks,
Yury

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ