[CRIU] [PATCHv2 10/12] util-vdso: Check chain for STN_UNDEF

Dmitry Safonov dima at arista.com
Wed May 29 19:15:13 MSK 2019


Rather than chain[chain] != STN_UNDEF.
Seems like, on !ARM32 vdso there are more symbols and less chance to hit
this "feature".

Fixes parsing of __vdso_clock_gettime symbol on v5.1 arm kernel.

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 criu/pie/util-vdso.c      | 2 +-
 test/zdtm/static/vdso01.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/criu/pie/util-vdso.c b/criu/pie/util-vdso.c
index 6213df9a42d0..104da0633240 100644
--- a/criu/pie/util-vdso.c
+++ b/criu/pie/util-vdso.c
@@ -242,7 +242,7 @@ static void parse_elf_symbols(uintptr_t mem, size_t size, Phdr_t *load,
 		const char * symbol = vdso_symbols[i];
 		k = elf_hash((const unsigned char *)symbol);
 
-		for (j = bucket[k % nbucket]; j < nchain && chain[j] != STN_UNDEF; j = chain[j]) {
+		for (j = bucket[k % nbucket]; j < nchain && j != STN_UNDEF; j = chain[j]) {
 			addr = mem + dyn_symtab->d_un.d_ptr - load->p_vaddr;
 			Sym_t *sym;
 			char *name;
diff --git a/test/zdtm/static/vdso01.c b/test/zdtm/static/vdso01.c
index be733663cd36..269688c5e00b 100644
--- a/test/zdtm/static/vdso01.c
+++ b/test/zdtm/static/vdso01.c
@@ -246,7 +246,7 @@ static int vdso_fill_symtable(char *mem, size_t size, struct vdso_symtable *t)
 	for (i = 0; i < ARRAY_SIZE(vdso_symbols); i++) {
 		k = elf_hash((const unsigned char *)vdso_symbols[i]);
 
-		for (j = bucket[k % nbucket]; j < nchain && chain[j] != STN_UNDEF; j = chain[j]) {
+		for (j = bucket[k % nbucket]; j < nchain && j != STN_UNDEF; j = chain[j]) {
 			Sym_t *sym = (void *)&mem[dyn_symtab->d_un.d_ptr - load->p_vaddr];
 			char *name;
 
-- 
2.21.0



More information about the CRIU mailing list