From: Ian Munsie <hidden> Date: 2016-06-29 18:55:35
From: Ian Munsie <redacted>
If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.
Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.
Signed-off-by: Ian Munsie <redacted>
---
drivers/misc/cxl/context.c | 2 ++
drivers/misc/cxl/irq.c | 3 ---
2 files changed, 2 insertions(+), 3 deletions(-)
@@ -260,9 +260,6 @@ int afu_allocate_irqs(struct cxl_context *ctx, u32 count)elsealloc_count=count+1;-/* Initialize the list head to hold irq names */-INIT_LIST_HEAD(&ctx->irq_names);-if((rc=cxl_ops->alloc_irq_ranges(&ctx->irqs,ctx->afu->adapter,alloc_count)))returnrc;
From: Andrew Donnellan <hidden> Date: 2016-06-29 22:28:30
On 30/06/16 04:55, Ian Munsie wrote:
From: Ian Munsie <redacted>
If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.
Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.
Signed-off-by: Ian Munsie <redacted>
As it's nice having your machine not crash on every shutdown...
Reviewed-by: Andrew Donnellan <redacted>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-06-30 05:00:31
On Thu, 2016-06-30 at 08:28 +1000, Andrew Donnellan wrote:
On 30/06/16 04:55, Ian Munsie wrote:
quoted
From: Ian Munsie <redacted>
If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.
Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.
Signed-off-by: Ian Munsie <redacted>
As it's nice having your machine not crash on every shutdown...
From: Andrew Donnellan <hidden> Date: 2016-06-30 05:15:12
On 30/06/16 15:00, Michael Ellerman wrote:
On Thu, 2016-06-30 at 08:28 +1000, Andrew Donnellan wrote:
quoted
On 30/06/16 04:55, Ian Munsie wrote:
quoted
From: Ian Munsie <redacted>
If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.
Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.
Signed-off-by: Ian Munsie <redacted>
quoted
As it's nice having your machine not crash on every shutdown...
Fixes: ????
Ian can correct me if I'm wrong, but I suspect this doesn't affect
cxlflash (the only current user of the cxl kernel API) - this issue was
hit while working on CAPI support for mlx5.
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
From: Ian Munsie <hidden> Date: 2016-06-30 06:24:40
Excerpts from andrew.donnellan's message of 2016-06-30 15:15:02 +1000:
On 30/06/16 15:00, Michael Ellerman wrote:
quoted
On Thu, 2016-06-30 at 08:28 +1000, Andrew Donnellan wrote:
quoted
On 30/06/16 04:55, Ian Munsie wrote:
quoted
From: Ian Munsie <redacted>
If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.
Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.
Signed-off-by: Ian Munsie <redacted>
quoted
As it's nice having your machine not crash on every shutdown...
Fixes: ????
Ian can correct me if I'm wrong, but I suspect this doesn't affect
cxlflash (the only current user of the cxl kernel API) - this issue was
hit while working on CAPI support for mlx5.
Correct - no current user hits this bug, but the upcoming mlx5 support
does because of the way it uses interrupts.
-Ian
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2016-07-11 10:19:28
On Wed, 2016-29-06 at 18:55:17 UTC, Ian Munsie wrote:
From: Ian Munsie <redacted>
If a kernel context is initialised and does not have any AFU interrupts
allocated it will cause a NULL pointer dereference when the context is
detached since the irq_names list will not have been initialised.
Move the initialisation of the irq_names list into the cxl_context_init
routine so that it will be valid for the entire lifetime of the context
and will not cause a NULL pointer dereference.
Signed-off-by: Ian Munsie <redacted>
Reviewed-by: Andrew Donnellan <redacted>