* [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
@ 2007-10-02 21:38 akpm
2007-10-02 22:07 ` James Bottomley
2007-10-05 21:16 ` James Bottomley
0 siblings, 2 replies; 4+ messages in thread
From: akpm @ 2007-10-02 21:38 UTC (permalink / raw)
To: James.Bottomley; +Cc: linux-scsi, akpm, jesper.juhl
From: Jesper Juhl <jesper.juhl@gmail.com>
The Coverity checker noticed that we have a potential NULL pointer
deref in drivers/scsi/aic7xxx/aic7xxx_core.c::ahc_print_register().
This patch handles it by adding the same test against NULL that is
used elsewhere in the same function.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/scsi/aic7xxx/aic7xxx_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff -puN drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function drivers/scsi/aic7xxx/aic7xxx_core.c
--- a/drivers/scsi/aic7xxx/aic7xxx_core.c~fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function
+++ a/drivers/scsi/aic7xxx/aic7xxx_core.c
@@ -6557,7 +6557,8 @@ ahc_print_register(ahc_reg_parse_entry_t
printed = printf("%s[0x%x]", name, value);
if (table == NULL) {
printed += printf(" ");
- *cur_column += printed;
+ if (cur_column != NULL)
+ *cur_column += printed;
return (printed);
}
printed_mask = 0;
_
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
2007-10-02 21:38 [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function akpm
@ 2007-10-02 22:07 ` James Bottomley
2007-10-05 21:16 ` James Bottomley
1 sibling, 0 replies; 4+ messages in thread
From: James Bottomley @ 2007-10-02 22:07 UTC (permalink / raw)
To: akpm; +Cc: linux-scsi, jesper.juhl
On Tue, 2007-10-02 at 14:38 -0700, akpm@linux-foundation.org wrote:
> From: Jesper Juhl <jesper.juhl@gmail.com>
>
> The Coverity checker noticed that we have a potential NULL pointer
> deref in drivers/scsi/aic7xxx/aic7xxx_core.c::ahc_print_register().
> This patch handles it by adding the same test against NULL that is
> used elsewhere in the same function.
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
No. Reasons formerly given here:
http://marc.info/?l=linux-scsi&m=118632919511846&w=2
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
2007-10-02 21:38 [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function akpm
2007-10-02 22:07 ` James Bottomley
@ 2007-10-05 21:16 ` James Bottomley
2007-10-05 22:23 ` Jesper Juhl
1 sibling, 1 reply; 4+ messages in thread
From: James Bottomley @ 2007-10-05 21:16 UTC (permalink / raw)
To: akpm; +Cc: linux-scsi, jesper.juhl
On Tue, 2007-10-02 at 14:38 -0700, akpm@linux-foundation.org wrote:
> From: Jesper Juhl <jesper.juhl@gmail.com>
>
> The Coverity checker noticed that we have a potential NULL pointer
> deref in drivers/scsi/aic7xxx/aic7xxx_core.c::ahc_print_register().
> This patch handles it by adding the same test against NULL that is
> used elsewhere in the same function.
>
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
No. Reasons formerly given here:
http://marc.info/?l=linux-scsi&m=118632919511846&w=2
James
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
2007-10-05 21:16 ` James Bottomley
@ 2007-10-05 22:23 ` Jesper Juhl
0 siblings, 0 replies; 4+ messages in thread
From: Jesper Juhl @ 2007-10-05 22:23 UTC (permalink / raw)
To: James Bottomley; +Cc: akpm, linux-scsi
On 05/10/2007, James Bottomley <James.Bottomley@steeleye.com> wrote:
> On Tue, 2007-10-02 at 14:38 -0700, akpm@linux-foundation.org wrote:
> > From: Jesper Juhl <jesper.juhl@gmail.com>
> >
> > The Coverity checker noticed that we have a potential NULL pointer
> > deref in drivers/scsi/aic7xxx/aic7xxx_core.c::ahc_print_register().
> > This patch handles it by adding the same test against NULL that is
> > used elsewhere in the same function.
> >
> > Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>
> No. Reasons formerly given here:
>
> http://marc.info/?l=linux-scsi&m=118632919511846&w=2
>
The reasons that patch sticks around was given by Andrew in a mail
send to me, you and Justin Gibbs on Aug 8.
My reply to that mail (including Andrew's original) is below, but you
should be able to also find it in your own archives.
Basically Andrew said:
"That's the sort of patch I keep around to prevent the issue from
getting swept under the table. This usually results in me sitting on
the sorry thing for literally years :("
---[ quote from old email - start ]---
> from Jesper Juhl <jesper.juhl@gmail.com>
> to Andrew Morton <akpm@linux-foundation.org>
> cc
> James Bottomley <James.Bottomley@steeleye.com>,
> Justin T. Gibbs <gibbs@scsiguy.com>
> date 8 Aug 2007 00:43
> subject Re: + avoid-a-small-unlikely-memory-leak-in-proc_read_escd.patch added to > -mm tree
> mailed-by gmail.com
> On 08/08/07, Andrew Morton <akpm@linux-foundation.org> wrote:
> > On Wed, 8 Aug 2007 00:26:43 +0200
> > "Jesper Juhl" <jesper.juhl@gmail.com> wrote:
> >
> > > This reply was meant for
> > >
> > > > The patch titled
> > > > Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function
> > > > has been added to the -mm tree. Its filename is
> > > > fix-a-potential-null-pointer-deref-in-the-aic7xxx-ahc_print_register-function.patch
> > > >
> >
> > That's the sort of patch I keep around to prevent the issue from getting
> > swept under the table. This usually results in me sitting on the sorry
> > thing for literally years :(
> >
> Ok, in that case you may want to keep it around in -mm despite James'
> objections - I'll leave that up to you. But it probably shouldn't move
> towards mainline...
>
> > Feel free to send a replacement patch which gets us closer to the real fix.
> > Remove all the NULL tests, maybe.
> >
> I don't have a good idea on how to solve this better at the moment.
> But if I come up with something I'll be sure to send it to you and
> James.
>
---[ quote from old email - end ]---
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-05 22:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-02 21:38 [patch 08/17] Fix a potential NULL pointer deref in the aic7xxx, ahc_print_register() function akpm
2007-10-02 22:07 ` James Bottomley
2007-10-05 21:16 ` James Bottomley
2007-10-05 22:23 ` Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox