libX11: Changes to 'master'
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 25 01:24:48 UTC 2021
modules/im/ximcp/imLcPrs.c | 4 +++-
src/xlibi18n/lcDB.c | 8 +++++---
2 files changed, 8 insertions(+), 4 deletions(-)
New commits:
commit d01d23374107f6fc55511f02559cf75be7bdf448
Author: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
Date: Wed Jun 16 12:17:04 2021 +0100
Avoid undefined behaviour after realloc()
Adding the offset between the realloc result and the old allocation to
update pointers into the new allocation is undefined behaviour: the
old pointers are no longer valid after realloc() according to the C
standard. While this works on almost all architectures and compilers,
it causes problems on architectures that track pointer bounds (e.g.
CHERI or Arm's Morello): the value_list pointers will still have the
bounds of the previous allocation and therefore any dereference will
result in a run-time trap.
I found this due to a crash (dereferencing an invalid capability) while
trying to run `xev` over SSH on a CHERI-RISC-V system. With these two
realloc changes, and https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/41
I am able to succesfully run `xev` compiled for CHERI-RISC-V.
Signed-off-by: Alex Richardson <Alexander.Richardson at cl.cam.ac.uk>
More information about the xorg-commit
mailing list