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]
Date:	Mon, 30 Jan 2012 10:52:52 -0800
From:	Yinghai Lu <yinghai@...nel.org>
To:	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	Jesse Barnes <jbarnes@...tuousgeek.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Tony Luck <tony.luck@...el.com>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-arch@...r.kernel.org
Subject: Re: [PATCH 10/13] PCI: Strict checking of valid range for bridge

On Mon, Jan 30, 2012 at 8:04 AM, Bjorn Helgaas <bhelgaas@...gle.com> wrote:
> On Fri, Jan 27, 2012 at 6:49 PM, Yinghai Lu <yinghai@...nel.org> wrote:
>> children bridges busn range should be able to be allocated from parent bus range.
>>
>> to avoid overlapping between sibling bridges on same bus.
>>
>> Signed-off-by: Yinghai Lu <yinghai@...nel.org>
>> ---
>>  drivers/pci/probe.c |   27 +++++++++++++++++++++++++++
>>  1 files changed, 27 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> index 83df3fb..e12f65f0 100644
>> --- a/drivers/pci/probe.c
>> +++ b/drivers/pci/probe.c
>> @@ -791,6 +791,33 @@ reduce_needed_size:
>>        return ret;
>>  }
>>
>> +static int __devinit pci_bridge_check_busn_res(struct pci_bus *bus,
>> +                               struct pci_dev *dev,
>> +                               int secondary, int subordinate)
>
> This function returns a boolean, but the function name doesn't give
> any clue about what a true/false return means.  Something like
> "busn_valid" would make the callers more readable.

ok

>
>> +{
>> +       int broken = 0;
>> +
>> +       struct resource busn_res;
>> +       int ret;
>> +
>> +       memset(&busn_res, 0, sizeof(struct resource));
>> +       dev_printk(KERN_DEBUG, &dev->dev,
>> +                "check if busn %02x-%02x is in busn_res: %06llx-%06llx\n",
>> +                secondary, subordinate,
>> +                (unsigned long long)bus->busn_res.start,
>> +                (unsigned long long)bus->busn_res.end);
>> +       ret = allocate_resource(&bus->busn_res, &busn_res,
>> +                        (subordinate - secondary + 1),
>> +                        (pci_domain_nr(bus)<<8) | secondary,
>> +                        (pci_domain_nr(bus)<<8) | subordinate,
>
> I think this "(pci_domain_nr(bus)<<8) | secondary" stuff needs to be a
> macro or something.

maybe.
--
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