Skip to contentSkip to conversation

Drivers: hv: vmbus: Fix virt_to_hvpfn() for X86_PAE

PATCH Applied Dexuan Cui 4 participants 5 messages May 7, 2019 – Aug 20, 2019

Subsystems (3)
lore
Share & tools
lore

Dexuan Cui

author maintainer
#0 lore raw

PATCH 1/1 Drivers: hv: vmbus: Fix virt_to_hvpfn() for X86_PAE

In the case of X86_PAE, unsigned long is u32, but the physical address type should be u64. Due to the bug here, the netvsc driver can not load successfully, and sometimes the VM can panic due to memory corruption (the hypervisor writes data to the wrong location).

Fixes 6ba34171bcbd ("Drivers: hv: vmbus: Remove use of slow_virt_to_phys()")
Cc Michael Kelley <[email protected]>
---
 drivers/hv/channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/channel.c +1 -1
index 23381c41d087..aaaee5f93193 100644
@@ -38,7 +38,7 @@
 
 static unsigned long virt_to_hvpfn(void *addr)
 {
-	unsigned long paddr;
+	phys_addr_t paddr;
 
 	if (is_vmalloc_addr(addr))
 		paddr = page_to_phys(vmalloc_to_page(addr)) +
Signature · 1 line
2.17.1
Reviewed-by on v1 1/1
#1 lore raw

From: Dexuan Cui <[email protected]> Sent: Tuesday, May 7, 2019 12:47 AM

Quoted 11 lines

In the case of X86_PAE, unsigned long is u32, but the physical address type should be u64. Due to the bug here, the netvsc driver can not load successfully, and sometimes the VM can panic due to memory corruption (the hypervisor writes data to the wrong location).

Fixes 6ba34171bcbd ("Drivers: hv: vmbus: Remove use of slow_virt_to_phys()")
Cc Michael Kelley <[email protected]>
maintainer Applied
#2 lore raw
Quoted 7 lines · Michael Kelley

From: Dexuan Cui <[email protected]> Sent: Tuesday, May 7, 2019 12:47 AM

Quoted 6 lines

In the case of X86_PAE, unsigned long is u32, but the physical address type should be u64. Due to the bug here, the netvsc driver can not load successfully, and sometimes the VM can panic due to memory corruption (the hypervisor writes data to the wrong location).

Quoted 7 lines
Quoted 5 lines
Fixes 6ba34171bcbd ("Drivers: hv: vmbus: Remove use of slow_virt_to_phys()")
Cc Michael Kelley <[email protected]>

Queued for hyperv-fixes, thanks!

--
Thanks,
Sasha

#3 lore raw

Hi Sasha.

I haven't spotted the following patch in the hyperv-fixes branch.

Did I look in the wrong place or it was not applied?

Thanks,
Juliana.

Quoted 21 lines · Sasha Levin
Quoted 7 lines · Michael Kelley

From: Dexuan Cui <[email protected]> Sent: Tuesday, May 7, 2019 12:47 AM

Quoted 6 lines

In the case of X86_PAE, unsigned long is u32, but the physical address type should be u64. Due to the bug here, the netvsc driver can not load successfully, and sometimes the VM can panic due to memory corruption (the hypervisor writes data to the wrong location).

Quoted 7 lines
Quoted 5 lines
Fixes 6ba34171bcbd ("Drivers: hv: vmbus: Remove use of slow_virt_to_phys()")
Cc Michael Kelley <[email protected]>

Queued for hyperv-fixes, thanks!

Signature · 2 lines
Thanks,
Sasha
maintainer
#4 lore raw
Quoted 5 lines · Juliana Rodrigueiro

Hi Sasha.

I haven't spotted the following patch in the hyperv-fixes branch.

Did I look in the wrong place or it was not applied?

I've previously dropped it, it's in there now.

--
Thanks,
Sasha