Skip to contentSkip to conversation

SELinux: null dereference in error path

PATCH In review Alexander Nyberg 6 participants 6 messages Mar 1, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SELinux: null dereference in error path

The 'bad' label will call function that unconditionally dereferences the NULL pointer.

Found by the Coverity tool

===== security/selinux/ss/policydb.c 1.16 vs edited =====

security/selinux/ss/policydb.c +1 -1
@@ -773,7 +773,7 @@ static int class_read(struct policydb *p
 	cladatum = kmalloc(sizeof(*cladatum), GFP_KERNEL);
 	if (!cladatum) {
 		rc = -ENOMEM;
-		goto bad;
+		goto out;
 	}
 	memset(cladatum, 0, sizeof(*cladatum));
 
Acked-by Jane McDonald
#2 lore raw
Quoted 10 lines · James Morris
Quoted 6 lines · Alexander Nyberg

The 'bad' label will call function that unconditionally dereferences the NULL pointer.

Found by the Coverity tool

Err, isn't it "Acked-by:"?? I thought "Signed-off-by:" was only for when the patch actually went through someone's tree and was forwarded by them to somebody else:

EG:
John Doe writes a patch that fixes a NULL pointer deref, and he sends it to Andrew Morton. The maintainer of the driver, Jane McDonald, confirms the fix via email to this list. Andrew forwards it to Linus, who includes it in his next release. The resulting notations look like this:

Signed-off-by John Doe
Acked-by Jane McDonald
Signed-off-by Andrew Morton
Signed-off-by Linus Torvalds

Cheers,
Kyle Moffett

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$ L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+ PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r !y?(-) ------END GEEK CODE BLOCK------

#3 lore raw
Quoted 2 lines · Kyle Moffett

Err, isn't it "Acked-by:"??

Yes, I usually change it to Acked-by when it's obvious.

Signed-off-by:  "I worked on this patch"
Acked-by:       "Looks good"
Tested-by:      "You're kidding"
#4 lore raw
In reply to Kyle Moffett
Quoted 9 lines
Quoted 5 lines
Quoted 4 lines

The 'bad' label will call function that unconditionally dereferences the NULL pointer.
Found by the Coverity tool

Err, isn't it "Acked-by:"?? I thought "Signed-off-by:" was only for when
the patch actually went through someone's tree and was forwarded by them to somebody else:

Isn't also a good idea to sign your message with gpg or so? That way one is 100% sure that it *is* that person who is signing-off or acking-by.

Folkert van Heusden

Op zoek naar een IT of Finance baan? Mail me voor de mogelijkheden!

+------------------------------------------------------------------+
|UNIX admin? Then give MultiTail (http://vanheusden.com/multitail/)|
|a try, it brings monitoring logfiles to a different level! See    |
|http://vanheusden.com/multitail/features.html for a feature list. |
+------------------------------------------= www.unixsoftware.nl =-+

Phone: +31-6-41278122, PGP-key: 1F28D8AE
Get your PGP/GPG key signed at www.biglumber.com!