svn commit: r366094 - in stable: 11/lib/libc/gen 12/lib/libc/gen

John Baldwin jhb at FreeBSD.org
Wed Sep 23 21:57:30 UTC 2020


Author: jhb
Date: Wed Sep 23 21:57:29 2020
New Revision: 366094
URL: https://svnweb.freebsd.org/changeset/base/366094

Log:
  MFC 365278: Don't assume objects in program sections have a size of a pointer.
  
  The size of the object at 'addr' is unknown and might be smaller than
  the size of a pointer (e.g. some x86 instructions are smaller than a
  pointer).  Instead, just check that the address is in the bounds of
  the program header.

Modified:
  stable/12/lib/libc/gen/elf_utils.c
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/lib/libc/gen/elf_utils.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/lib/libc/gen/elf_utils.c
==============================================================================
--- stable/12/lib/libc/gen/elf_utils.c	Wed Sep 23 19:54:59 2020	(r366093)
+++ stable/12/lib/libc/gen/elf_utils.c	Wed Sep 23 21:57:29 2020	(r366094)
@@ -65,7 +65,7 @@ __elf_phdr_match_addr(struct dl_phdr_info *phdr_info, 
 #endif
 
 		if (phdr_info->dlpi_addr + ph->p_vaddr <= (uintptr_t)addr &&
-		    (uintptr_t)addr + sizeof(addr) < phdr_info->dlpi_addr +
+		    (uintptr_t)addr < phdr_info->dlpi_addr +
 		    ph->p_vaddr + ph->p_memsz)
 			break;
 	}


More information about the svn-src-all mailing list