* BUG null dereference in drivers/ata/sata_mv.c
@ 2009-12-14 20:51 Alexander Strakh
2009-12-15 1:34 ` Robert Hancock
2009-12-17 6:25 ` Jeff Garzik
0 siblings, 2 replies; 3+ messages in thread
From: Alexander Strakh @ 2009-12-14 20:51 UTC (permalink / raw)
To: Mark Lord, linux-ide, David S. Miller, linux-kernel
KERNEL_VERSION: 2.6.32
SUBJECT: null dereference in function mv_unexpected_intr
DESCRIBE:
In ./drivers/ata/sata_mv.c in function mv_port_intr
1. If ap == NULL in line 2778, then we goto line 2779.
2. In line 2779 function mv_unexpected_intr(ap, 0) is called.
3. In line 2538 null dereference: "ap->link.eh_info"
2773 static void mv_port_intr(struct ata_port *ap, u32 port_cause)
2774 {
...
2778 if (!ap || (ap->flags & ATA_FLAG_DISABLED)) {
2779 mv_unexpected_intr(ap, 0);
2780 return;
2781 }
...
2809 }
2536 static void mv_unexpected_intr(struct ata_port *ap, int edma_was_enabled)
2537 {
2538 struct ata_eh_info *ehi = &ap->link.eh_info;
...
2555 }
Found by Linux Device Drivers Verification Project (Svace Detector)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: BUG null dereference in drivers/ata/sata_mv.c
2009-12-14 20:51 BUG null dereference in drivers/ata/sata_mv.c Alexander Strakh
@ 2009-12-15 1:34 ` Robert Hancock
2009-12-17 6:25 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Robert Hancock @ 2009-12-15 1:34 UTC (permalink / raw)
To: Alexander Strakh; +Cc: Mark Lord, linux-ide, David S. Miller, linux-kernel
On 12/14/2009 02:51 PM, Alexander Strakh wrote:
> KERNEL_VERSION: 2.6.32
> SUBJECT: null dereference in function mv_unexpected_intr
> DESCRIBE:
> In ./drivers/ata/sata_mv.c in function mv_port_intr
>
> 1. If ap == NULL in line 2778, then we goto line 2779.
> 2. In line 2779 function mv_unexpected_intr(ap, 0) is called.
> 3. In line 2538 null dereference: "ap->link.eh_info"
>
> 2773 static void mv_port_intr(struct ata_port *ap, u32 port_cause)
> 2774 {
> ...
> 2778 if (!ap || (ap->flags& ATA_FLAG_DISABLED)) {
> 2779 mv_unexpected_intr(ap, 0);
> 2780 return;
> 2781 }
> ...
> 2809 }
>
> 2536 static void mv_unexpected_intr(struct ata_port *ap, int edma_was_enabled)
> 2537 {
> 2538 struct ata_eh_info *ehi =&ap->link.eh_info;
> ...
> 2555 }
>
> Found by Linux Device Drivers Verification Project (Svace Detector)
I don't think it should be possible for ap to be null at the point the
check is made. The null check could likely be removed.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: BUG null dereference in drivers/ata/sata_mv.c
2009-12-14 20:51 BUG null dereference in drivers/ata/sata_mv.c Alexander Strakh
2009-12-15 1:34 ` Robert Hancock
@ 2009-12-17 6:25 ` Jeff Garzik
1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2009-12-17 6:25 UTC (permalink / raw)
To: Alexander Strakh; +Cc: Mark Lord, linux-ide, David S. Miller, linux-kernel
On 12/14/2009 03:51 PM, Alexander Strakh wrote:
> KERNEL_VERSION: 2.6.32
> SUBJECT: null dereference in function mv_unexpected_intr
> DESCRIBE:
> In ./drivers/ata/sata_mv.c in function mv_port_intr
>
> 1. If ap == NULL in line 2778, then we goto line 2779.
> 2. In line 2779 function mv_unexpected_intr(ap, 0) is called.
> 3. In line 2538 null dereference: "ap->link.eh_info"
>
> 2773 static void mv_port_intr(struct ata_port *ap, u32 port_cause)
> 2774 {
> ...
> 2778 if (!ap || (ap->flags& ATA_FLAG_DISABLED)) {
> 2779 mv_unexpected_intr(ap, 0);
> 2780 return;
pointless null test removed...
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-17 6:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-14 20:51 BUG null dereference in drivers/ata/sata_mv.c Alexander Strakh
2009-12-15 1:34 ` Robert Hancock
2009-12-17 6:25 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).