]> git.karo-electronics.de Git - karo-tx-linux.git/commit
SCSI: aacraid: Eliminate use after free
authorJulia Lawall <julia@diku.dk>
Sat, 15 May 2010 09:46:12 +0000 (11:46 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:20:50 +0000 (10:20 -0700)
commitde40885b3c038fb7934f798d3cab823cd5985955
tree5c590ad416f8b603f830135e49303a97d9f8b969
parentbebd876038404b65c24decd45b4dbe3095805798
SCSI: aacraid: Eliminate use after free

commit 8a52da632ceb9d8b776494563df579e87b7b586b upstream.

The debugging code using the freed structure is moved before the kfree.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@free@
expression E;
position p;
@@
kfree@p(E)

@@
expression free.E, subE<=free.E, E1;
position free.p;
@@

  kfree@p(E)
  ...
(
  subE = E1
|
* E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/aacraid/commctrl.c