]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r335515 (by chuck@):
authordchagin <dchagin@FreeBSD.org>
Sun, 28 Apr 2019 14:08:05 +0000 (14:08 +0000)
committerdchagin <dchagin@FreeBSD.org>
Sun, 28 Apr 2019 14:08:05 +0000 (14:08 +0000)
commit7605aa9e65d60bcefd34e1f6c0de1e90bdd9e84f
treeaf11a75652dbc52e09ea474ba5119065357d4c6c
parent0f421dd58541c71b80ca2d87700fb8a5cc636b6e
MFC r335515 (by chuck@):

Fix the Linux kernel version number calculation

The Linux compatibility code was converting the version number (e.g.
2.6.32) in two different ways and then comparing the results.

The linux_map_osrel() function converted MAJOR.MINOR.PATCH similar to
what FreeBSD does natively. I.e. where major=v0, minor=v1, and patch=v2
    v = v0 * 1000000 + v1 * 1000 + v2;

The LINUX_KERNVER() macro, on the other hand, converted the value with
bit shifts. I.e. where major=a, minor=b, and patch=c
    v = (((a) << 16) + ((b) << 8) + (c))

The Linux kernel uses the later format via the KERNEL_VERSION() macro in
include/generated/uapi/linux/version.h

Fix is to use the LINUX_KERNVER() macro in linux_map_osrel() as well as
in the .trans_osrel functions.

PR: 229209
sys/amd64/linux/linux_sysvec.c
sys/amd64/linux32/linux32_sysvec.c
sys/compat/linux/linux_mib.c
sys/i386/linux/linux_sysvec.c