android_kernel_motorola_sm6375/tools
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rasmus Villemoes c8938263e6 tools/nolibc/string: Fix memcmp() implementation
commit b3f4f51ea68a495f8a5956064c33dce711a2df91 upstream.

The C standard says that memcmp() must treat the buffers as consisting
of "unsigned chars". If char happens to be unsigned, the casts are ok,
but then obviously the c1 variable can never contain a negative
value. And when char is signed, the casts are wrong, and there's still
a problem with using an 8-bit quantity to hold the difference, because
that can range from -255 to +255.

For example, assuming char is signed, comparing two 1-byte buffers,
one containing 0x00 and another 0x80, the current implementation would
return -128 for both memcmp(a, b, 1) and memcmp(b, a, 1), whereas one
of those should of course return something positive.

Signed-off-by: Rasmus Villemoes <[email protected]>
Fixes: 66b6f755ad ("rcutorture: Import a copy of nolibc")
Cc: [email protected] # v5.0+
Signed-off-by: Willy Tarreau <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2022-11-10 17:57:55 +01:00
..
accounting
arch x86/speculation: Add RSB VM Exit protections 2022-10-07 09:16:56 +02:00
bpf bpftool: Clear errno after libcap's checks 2022-10-26 13:22:48 +02:00
build tools build: Switch to new openssl API for test-libcrypto 2022-08-25 11:18:25 +02:00
cgroup
debugging
firewire
firmware
gpio
hv
iio tools: iio: iio_utils: fix digit calculation 2022-11-03 23:56:53 +09:00
include tools/nolibc/string: Fix memcmp() implementation 2022-11-10 17:57:55 +01:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix the name of a reused map 2022-08-25 11:17:43 +02:00
memory-model
nfsd
objtool x86/xen: Mark cpu_bringup_and_idle() as dead_end_function 2022-05-25 09:14:38 +02:00
pci
pcmcia
perf perf auxtrace: Fix address filter symbol name match for modules 2022-11-03 23:56:54 +09:00
power tools/power turbostat: fix ICX DRAM power numbers 2022-06-14 18:11:25 +02:00
scripts
spi
testing selftests: Fix the if conditions of in test_extra_filter() 2022-10-05 10:37:45 +02:00
thermal/tmon tools/thermal: Fix possible path truncations 2022-08-25 11:18:09 +02:00
time
usb usb: testusb: Fix for showing the connection speed 2021-10-09 14:39:49 +02:00
virtio
vm tools/vm/slabinfo: use alphabetic order when two values are equal 2022-08-25 11:18:25 +02:00
wmi
Makefile