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]
Date:   Wed, 14 Jul 2021 15:37:46 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Jiri Slaby <jirislaby@...nel.org>
Cc:     linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1 1/4] serial: 8250_pci: Refactor the loop in
 pci_ite887x_init()

On Wed, Jul 14, 2021 at 08:57:06AM +0200, Jiri Slaby wrote:
> On 13. 07. 21, 12:40, Andy Shevchenko wrote:
> > The loop can be refactored by using ARRAY_SIZE() instead of NULL terminator.
> > This reduces code base and makes it easier to read and understand.

> > +		iobase = request_region(inta_addr[i], ITE_887x_IOSIZE, "ite887x");
> 
> Irrelevant whitespace change.
> 
> >   		if (iobase != NULL) {
> >   			/* write POSIO0R - speed | size | ioport */
> >   			pci_write_config_dword(dev, ITE_887x_POSIO0,
> >   				ITE_887x_POSIO_ENABLE | ITE_887x_POSIO_SPEED |
> >   				ITE_887x_POSIO_IOSIZE_32 | inta_addr[i]);
> >   			/* write INTCBAR - ioport */
> > -			pci_write_config_dword(dev, ITE_887x_INTCBAR,
> > -								inta_addr[i]);
> > +			pci_write_config_dword(dev, ITE_887x_INTCBAR, inta_addr[i]);
> 
> detto
> 
> >   			ret = inb(inta_addr[i]);
> >   			if (ret != 0xff) {
> >   				/* ioport connected */
> >   				break;
> >   			}
> >   			release_region(iobase->start, ITE_887x_IOSIZE);
> > -			iobase = NULL;
> >   		}
> > -		i++;

I believe with Joe's suggestion I can improve entire body of this branch
perhaps in a separate patch. Do you prefer one or two patches?

> >   	if (!inta_addr[i]) {
> 
> OOB access?

Yep, Dan reported the same. Missed during conversion. Will fix.

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ