[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180314202229.eck3aszdmwgsldyb@treble>
Date: Wed, 14 Mar 2018 15:22:29 -0500
From: Josh Poimboeuf <jpoimboe@...hat.com>
To: Joe Lawrence <joe.lawrence@...hat.com>
Cc: Petr Mladek <pmladek@...e.com>, Jiri Kosina <jikos@...nel.org>,
Miroslav Benes <mbenes@...e.cz>, Jessica Yu <jeyu@...nel.org>,
Nicolai Stange <nstange@...e.de>,
live-patching@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] livepatch: Initialize shadow variables by init
function safely
On Wed, Mar 14, 2018 at 03:43:01PM -0400, Joe Lawrence wrote:
> >> @@ -150,6 +145,23 @@ static void *__klp_shadow_get_or_alloc(void *obj, unsigned long id, void *data,
> >> goto exists;
> >> }
> >>
> >> + new_shadow->obj = obj;
> >> + new_shadow->id = id;
> >> +
> >> + if (init_func) {
> >> + int err;
> >> +
> >> + err = init_func(obj, new_shadow->data, init_data);
> >
> > Am I hallucinating, or will new_shadow->data always be NULL? How did it
> > even work before?
> >
> struct klp_shadow {
> struct hlist_node node;
> struct rcu_head rcu_head;
> void *obj;
> unsigned long id;
> char data[]; << not a pointer
> };
Ah. This code needs a nice comment above the kzalloc() call, so I won't
get confused again next time.
--
Josh
Powered by blists - more mailing lists