[2/4] dmicheck: drop unaligned memcpy
diff mbox series

Message ID 20181115232517.4588-3-leif.lindholm@linaro.org
State Accepted
Headers show
Series
  • various /dev/mem related cleanup
Related show

Commit Message

Leif Lindholm Nov. 15, 2018, 11:25 p.m. UTC
fwts_memcpy_unaligned was used to deal with the fact that the kernel was
giving access to smbios tables through /dev/mem on aarch64 with device
memory mappings.

This was never a valid way of accessing SMBIOS tables on aarch64, so now
/dev/mem access has been disabled on that architecture, go back to a normal
memcpy.

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 src/dmi/dmicheck/dmicheck.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Hung Nov. 16, 2018, 3:10 a.m. UTC | #1
On 2018-11-16 7:25 a.m., Leif Lindholm wrote:
> fwts_memcpy_unaligned was used to deal with the fact that the kernel was
> giving access to smbios tables through /dev/mem on aarch64 with device
> memory mappings.
> 
> This was never a valid way of accessing SMBIOS tables on aarch64, so now
> /dev/mem access has been disabled on that architecture, go back to a normal
> memcpy.
> 
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
>  src/dmi/dmicheck/dmicheck.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index ba6f03c0..c794973b 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -379,7 +379,7 @@ static void* dmi_table_smbios30(fwts_framework *fw, fwts_smbios30_entry *entry)
>  		}
>  		table = malloc(length);
>  		if (table)
> -			fwts_memcpy_unaligned(table, mem, length);
> +			memcpy(table, mem, length);
>  		(void)fwts_munmap(mem, length);
>  		return table;
>  	}
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Colin King Nov. 16, 2018, 9:04 a.m. UTC | #2
On 15/11/2018 23:25, Leif Lindholm wrote:
> fwts_memcpy_unaligned was used to deal with the fact that the kernel was
> giving access to smbios tables through /dev/mem on aarch64 with device
> memory mappings.
> 
> This was never a valid way of accessing SMBIOS tables on aarch64, so now
> /dev/mem access has been disabled on that architecture, go back to a normal
> memcpy.
> 
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> ---
>  src/dmi/dmicheck/dmicheck.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> index ba6f03c0..c794973b 100644
> --- a/src/dmi/dmicheck/dmicheck.c
> +++ b/src/dmi/dmicheck/dmicheck.c
> @@ -379,7 +379,7 @@ static void* dmi_table_smbios30(fwts_framework *fw, fwts_smbios30_entry *entry)
>  		}
>  		table = malloc(length);
>  		if (table)
> -			fwts_memcpy_unaligned(table, mem, length);
> +			memcpy(table, mem, length);
>  		(void)fwts_munmap(mem, length);
>  		return table;
>  	}
> 
Acked-by: Colin Ian King <colin.king@canonical.com>

Patch
diff mbox series

diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
index ba6f03c0..c794973b 100644
--- a/src/dmi/dmicheck/dmicheck.c
+++ b/src/dmi/dmicheck/dmicheck.c
@@ -379,7 +379,7 @@  static void* dmi_table_smbios30(fwts_framework *fw, fwts_smbios30_entry *entry)
 		}
 		table = malloc(length);
 		if (table)
-			fwts_memcpy_unaligned(table, mem, length);
+			memcpy(table, mem, length);
 		(void)fwts_munmap(mem, length);
 		return table;
 	}