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, 20 Nov 2013 18:00:12 +0000
From:	Will Deacon <will.deacon@....com>
To:	Vinayak Kale <vkale@....com>
Cc:	Marc Zyngier <Marc.Zyngier@....com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"jcm@...hat.com" <jcm@...hat.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>,
	Tuan Phan <tphan@....com>
Subject: Re: [PATCH V4 2/2] arm64: perf: add support for percpu pmu interrupt

On Wed, Nov 20, 2013 at 05:28:50PM +0000, Vinayak Kale wrote:
> In Will's existing code, I think he was taking care of 'no IRQ' case
> by comparing pmu_device->num_resources. Do you think this is not
> enough and we must enforce the check after each platform_get_irq()?
> Existing driver code snippet as below for quick reference.
> 
> [snip]
> static int
> armpmu_reserve_hardware(struct arm_pmu *armpmu)
> {
>         int i, err, irq, irqs;
>         struct platform_device *pmu_device = armpmu->plat_device;
> 
>         if (!pmu_device) {
>                 pr_err("no PMU device registered\n");
>                 return -ENODEV;
>         }
> 
>         irqs = min(pmu_device->num_resources, num_possible_cpus());
>         if (irqs < 1) {
>                 pr_err("no irqs for PMUs defined\n");
>                 return -ENODEV;
>         }

This bit is fine.

>         for (i = 0; i < irqs; ++i) {
>                 err = 0;
>                 irq = platform_get_irq(pmu_device, i);
>                 if (irq < 0)
>                          continue;

This is a bug, which you can fix in your patch. IRQ0 isn't valid.

Will
--
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