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, 24 Jun 2015 23:10:42 +0200 (CEST)
From:	Thomas Gleixner <tglx@...utronix.de>
To:	Julia Lawall <julia.lawall@...6.fr>
cc:	Jiang Liu <jiang.liu@...ux.intel.com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Ingo Molnar <mingo@...hat.com>,
	"H. Peter Anvin" <hpa@...or.com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Randy Dunlap <rdunlap@...radead.org>,
	Yinghai Lu <yinghai@...nel.org>,
	Borislav Petkov <bp@...en8.de>,
	Jason Cooper <jason@...edaemon.net>,
	Kevin Cernekee <cernekee@...il.com>,
	Arnd Bergmann <arnd@...db.de>,
	Marc Zyngier <marc.zyngier@....com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Tony Luck <tony.luck@...el.com>, x86@...nel.org,
	LKML <linux-kernel@...r.kernel.org>, linux-pci@...r.kernel.org,
	linux-acpi@...r.kernel.org
Subject: Re: [RFC v1 14/25] genirq: Kill the first parameter 'irq' of
 irq_flow_handler_t

On Sat, 13 Jun 2015, Julia Lawall wrote:
> On Sat, 13 Jun 2015, Thomas Gleixner wrote:
> 
> > On Sat, 13 Jun 2015, Julia Lawall wrote:
> > 
> > > The following are the cases that require some manual attention, either 
> > > because the handler is a local variable or because it is some other kind 
> > > of expression.
> > 
> > yep, found it in the logs already and found a missing search expression:
> > 
> > |
> > gpiochip_set_chained_irqchip@p(e1,e2,e3,\(lih\|ih\|eh\))
> > 
> > This is really impressive work!!!!
> 
> Thanks :)
> 
> I'll add the above pattern, but I guess you already have the results for 
> that case.

Yes.

I did some more experiments and analyzed all functions which have the
signature

[static] void f(T irq, struct irq_desc *desc)

where T is either 'unsigned int' or 'u32'

That throws up a handful of false positives, but those are functions
which are called from a real handler function, so we want to look at
those anyway.

Now where my cocci foo ends is when I try to match both types in the
same rule, i.e. 

@ fun exists @
identifier hf,irq,desc;
typedef u32;
@@

(
void hf(unsigned irq, struct irq_desc *desc) { ... }
|
void hf(u32 irq, struct irq_desc *desc) { ... }
)

results in:
Fatal error: exception Failure("minus: parse error: 
 = File "../cocci/find-pot-handler.cocci", line 7, column 5,  charpos = 63
    around = 'hf', whole content = void hf(unsigned irq, struct irq_desc *desc) { ... }
")

I tried a couple of other variants, but finally gave up and ran a
cocci script first which does s/u32/unsigned/ on those functions, but
of course because I'm lazy I wanted to do everything in one go. :)

Aside of that the ruleset you gave me works nicely except for that
part:

// no uses of the first parameter before the assignment
@@
identifier fun.hf,irq;
expression e;
type T;
fresh identifier firq = "__" ## irq;
position r.p,p1 != {s.p1,s1.p1};
@@

hf(T@p
- irq
+ firq
  ,...) {
  ... when != irq
      when strict
? irq@p1 = e
  ... when any
}

That lacks a:

+ unsigned int irq;

and therefor missed to add the local variable 'unsigned int irq' in
case the parameter is only used for local storage.

That was simple enough to fix even for me :)

Thanks,

	tglx

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