Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-31 Thread Miroslav Benes
On Wed, 30 Jan 2019, Petr Mladek wrote: > On Mon 2019-01-21 13:14:38, Miroslav Benes wrote: > > Hi, > > > > On Wed, 16 Jan 2019, Petr Mladek wrote: > > > > > Do not dereference pointers to the shadow variables when either > > > klp_shadow_alloc() or klp_shadow_get() fail. > > > > I may misunder

Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-30 Thread Petr Mladek
On Mon 2019-01-21 17:40:12, Joe Lawrence wrote: > On Wed, Jan 16, 2019 at 05:17:18PM +0100, Petr Mladek wrote: > > Do not dereference pointers to the shadow variables when either > > klp_shadow_alloc() or klp_shadow_get() fail. > > > > There is no need to check the other locations explicitly. The

Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-30 Thread Petr Mladek
On Mon 2019-01-21 13:14:38, Miroslav Benes wrote: > Hi, > > On Wed, 16 Jan 2019, Petr Mladek wrote: > > > Do not dereference pointers to the shadow variables when either > > klp_shadow_alloc() or klp_shadow_get() fail. > > I may misunderstand the patch, so bear with me, please. Is this because o

Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-21 Thread Joe Lawrence
On Wed, Jan 16, 2019 at 05:17:18PM +0100, Petr Mladek wrote: > Do not dereference pointers to the shadow variables when either > klp_shadow_alloc() or klp_shadow_get() fail. > > There is no need to check the other locations explicitly. The test > would fail if any allocation fails. And the existin

Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-21 Thread Miroslav Benes
Hi, On Wed, 16 Jan 2019, Petr Mladek wrote: > Do not dereference pointers to the shadow variables when either > klp_shadow_alloc() or klp_shadow_get() fail. I may misunderstand the patch, so bear with me, please. Is this because of a possible null pointer dereference? If yes, shouldn't this say

[PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest

2019-01-16 Thread Petr Mladek
Do not dereference pointers to the shadow variables when either klp_shadow_alloc() or klp_shadow_get() fail. There is no need to check the other locations explicitly. The test would fail if any allocation fails. And the existing messages, printed during the test, provide enough information to debu