[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e0cfd1d0608301040kf347dc8w6088a1fc8cd8b2b1@mail.gmail.com>
Date: Wed, 30 Aug 2006 19:40:19 +0200
From: "Martin Schwidefsky" <schwidefsky@...glemail.com>
To: "David Wagner" <daw-usenet@...erner.cs.berkeley.edu>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [S390] cio: kernel stack overflow.
On 8/30/06, David Wagner <daw@...berkeley.edu> wrote:
> Have you checked that in all cases all fields of the struct have
> been overwritten? For instance, look at this:
>
> Martin Schwidefsky wrote:
> >- chp->dev = (struct device) {
> >- .parent = &css[0]->device,
> >- .release = chp_release,
> >- };
> >+ chp->dev.parent = &css[0]->device;
> >+ chp->dev.release = chp_release;
>
> Doesn't this leave chp->dev.bus still holding whatever old value it
> had laying around before? Unless I'm missing something, it looks to
> me like this diff causes a change in the semantics of the code.
>
> Perhaps it would be better to memset() the entire struct (chp->dev, in
> this case) to zero, before assigning to individual fields, so there is
> no possibility of old remnant data still being left laying around?
The structure is allocated with kzalloc().
--
blue skies,
Martin
-
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