Drivers: hv: Fix bad pointer dereference in hv_get_partition_id
Subsystems (2)
PATCH 1/1 Drivers: hv: Fix bad pointer dereference in hv_get_partition_id
'output' is already a pointer to the output argument, it should be passed directly to hv_do_hypercall() without the '&' operator.
---
This patch is a fixup for:e96204e5e96e hyperv: Move hv_current_partition_id to arch-generic code
drivers/hv/hv_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/hv_common.c +1 -1
@@ -307,7 +307,7 @@ void __init hv_get_partition_id(void)local_irq_save (flags); output = *this_cpu_ptr (hyperv_pcpu_input_arg); - status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , &output); + status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , output); pt_id = output->partition_id;local_irq_restore (flags);
Signature · 1 line
2.34.1
From: Nuno Das Neves <[email protected]> Sent: Tuesday, April 1, 2025 10:32 AM
Quoted 26 lines
'output' is already a pointer to the output argument, it should be passed directly to
hv_do_hypercall()without the '&' operator.Signed-off-by Nuno Das Neves <[email protected]>---
This patch is a fixup for:e96204e5e96ehyperv: Movehv_current_partition_idto arch-generic codedrivers/hv/hv_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hv/hv_common.c +1
-2@@ -307,7 +307,7 @@ void __init hv_get_partition_id(void)local_irq_save (flags); output = *this_cpu_ptr (hyperv_pcpu_input_arg); - status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , &output); + status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , output); pt_id = output->partition_id;local_irq_restore (flags); --
Quoted 1 line
2.34.1
I should have caught that when I reviewed the original patch! :-(
Trying again,
Quoted 7 lines · Nuno Das Neves
'output' is already a pointer to the output argument, it should be passed directly to
hv_do_hypercall()without the '&' operator.Signed-off-by Nuno Das Neves <[email protected]>---
This patch is a fixup for:e96204e5e96ehyperv: Movehv_current_partition_idto arch-generic code
You can add Fixes: tag, so that it gets ported to previous kernel, in case, it does not make it to 6.14.
Regards,
Naman
Quoted 17 lines
drivers/hv/hv_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hv/hv_common.c +1
-1@@ -307,7 +307,7 @@ void __init hv_get_partition_id(void)local_irq_save (flags); output = *this_cpu_ptr (hyperv_pcpu_input_arg); - status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , &output); + status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , output); pt_id = output->partition_id;local_irq_restore (flags);
Wei Liu
maintainerQuoted 6 lines · Naman Jain
Quoted 3 lines · Nuno Das Neves
'output' is already a pointer to the output argument, it should be passed directly to
hv_do_hypercall()without the '&' operator.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Nuno Das Neves <[email protected]>---
This patch is a fixup for:e96204e5e96ehyperv: Movehv_current_partition_idto arch-generic codeYou can add Fixes: tag, so that it gets ported to previous kernel, in case, it does not make it to 6.14.
This does not need to be ported to older kernels because the bug was never released.
Wei.
Quoted 21 lines
Regards,
NamanQuoted 15 lines
drivers/hv/hv_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hv/hv_common.c +1
-1@@ -307,7 +307,7 @@ void __init hv_get_partition_id(void)local_irq_save (flags); output = *this_cpu_ptr (hyperv_pcpu_input_arg); - status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , &output); + status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , output); pt_id = output->partition_id;local_irq_restore (flags);
Wei Liu
maintainerQuoted 12 lines · Wei Liu
Quoted 11 lines · Naman Jain
Quoted 7 lines · Nuno Das Neves
'output' is already a pointer to the output argument, it should be passed directly to
hv_do_hypercall()without the '&' operator.Signed-off-by Nuno Das Neves <[email protected]>---
This patch is a fixup for:e96204e5e96ehyperv: Movehv_current_partition_idto arch-generic code
Quoted 5 lines
Quoted 2 lines
You can add Fixes: tag, so that it gets ported to previous kernel, in case, it does not make it to 6.14.
This does not need to be ported to older kernels because the bug was never released.
To be clear that was just a passing comment. I'm not against adding a Fixes tag. I've done that while applying this patch.
Thanks,
Wei.
Quoted 2 lines
'output' is already a pointer to the output argument, it should be passed directly to
hv_do_hypercall()without the '&' operator.
How do you think about to append parentheses to the function name in the summary phrase?
Regards,
Markus
Quoted 4 lines · Nuno Das Neves
'output' is already a pointer to the output argument, it should be passed directly to
hv_do_hypercall()without the '&' operator.Signed-off-by Nuno Das Neves <[email protected]>
Applied to hyperv-fixes. Thanks.
Quoted 23 lines
---
This patch is a fixup for:e96204e5e96ehyperv: Movehv_current_partition_idto arch-generic codedrivers/hv/hv_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hv/hv_common.c +1
-1@@ -307,7 +307,7 @@ void __init hv_get_partition_id(void)local_irq_save (flags); output = *this_cpu_ptr (hyperv_pcpu_input_arg); - status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , &output); + status =hv_do_hypercall (HVCALL_GET_PARTITION_ID ,NULL , output); pt_id = output->partition_id;local_irq_restore (flags);Signature · 1 line
2.34.1