mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
7c08461253
The m68 hand-written assembler version of strcmp() has always been
broken: it returns the difference between the first non-matching byte
done as a 8-bit subtraction.
That is _almost_ right, but is broken for the overflow case. The
strcmp() function should indeed return the sign of the difference
between the first byte that differs, but the subtraction needs to be
done in a wider type than 'char'. Otherwise the ordering isn't actually
stable.
This went unnoticed for basically forever, because nobody ever cares
about non-US-ASCII orderings in the kernel (in fact, most users only
care about "exact match or not"), so overflows don't really happen in
practice, even if it was very very wrong.
But that mostly unnoticeable bug becomes very noticeable by the recent
change to make 'char' be unsigned in the kernel across all architectures
(commit
|
||
---|---|---|
.. | ||
68000 | ||
amiga | ||
apollo | ||
atari | ||
bvme6000 | ||
coldfire | ||
configs | ||
emu | ||
fpsp040 | ||
hp300 | ||
ifpsp060 | ||
include | ||
kernel | ||
lib | ||
mac | ||
math-emu | ||
mm | ||
mvme16x | ||
mvme147 | ||
q40 | ||
sun3 | ||
sun3x | ||
tools/amiga | ||
virt | ||
install.sh | ||
Kbuild | ||
Kconfig | ||
Kconfig.bus | ||
Kconfig.cpu | ||
Kconfig.debug | ||
Kconfig.devices | ||
Kconfig.machine | ||
Makefile |