libports: rename jitterentropy's memcpy

To prevent symbol aliasing when using the static jitterentropy library
rename it to 'jent_memcpy'.

Fixes #4516.
This commit is contained in:
Josef Söntgen 2022-05-23 15:57:40 +02:00 committed by Christian Helmuth
parent c38b71146b
commit 03b2e3bda1
5 changed files with 19 additions and 5 deletions

View File

@ -1 +1 @@
b982a76430613834d1df5877fd528e4fa0c65fb2
a03bf871577242847d2be302ff4054197e8799e3

View File

@ -13,7 +13,8 @@ DIR_CONTENT(include/jitterentropy) := $(addprefix src/lib/jitterentropy/,\
jitterentropy.h)
PATCHES := src/lib/jitterentropy/jitterentropy_h.patch \
src/lib/jitterentropy/jitterentropy_delta_compare.patch
src/lib/jitterentropy/jitterentropy_delta_compare.patch \
src/lib/jitterentropy/jitterentropy_memcpy.patch
PATCH_OPT := -p1 -d src/lib/jitterentropy
#

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2014-2017 Genode Labs GmbH
* Copyright (C) 2014-2022 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
@ -42,7 +42,7 @@ void jent_zfree(void *ptr, unsigned int len)
}
void *memcpy(void *dest, const void *src, size_t n)
void *jent_memcpy(void *dest, const void *src, size_t n)
{
return Genode::memcpy(dest, src, n);
}

View File

@ -51,7 +51,7 @@ static inline __u64 rol64(__u64 word, unsigned int shift)
return (word << shift) | (word >> (64 - shift));
}
void *memcpy(void *dest, const void *src, size_t n);
void *jent_memcpy(void *dest, const void *src, size_t n);
#ifdef __cplusplus
}

View File

@ -0,0 +1,13 @@
diff --git a/jitterentropy-base.c b/jitterentropy-base.c
index 28b1462..3ea4c90 100644
--- a/jitterentropy-base.c
+++ b/jitterentropy-base.c
@@ -553,7 +553,7 @@ ssize_t jent_read_entropy(struct rand_data *ec, char *data, size_t len)
tocopy = (DATA_SIZE_BITS / 8);
else
tocopy = len;
- memcpy(p, &ec->data, tocopy);
+ jent_memcpy(p, &ec->data, tocopy);
len -= tocopy;
p += tocopy;