OpenCloudOS-Kernel/scripts/mod
Masahiro Yamada 106a1f3abb modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host
[ Upstream commit ac96a15a0f0c8812a3aaa587b871cd5527f6d736 ]

When MODULE_DEVICE_TABLE(ishtp, ) is built on a host with a different
endianness from the target architecture, it results in an incorrect
MODULE_ALIAS().

For example, see a case where drivers/platform/x86/intel/ishtp_eclite.c
is built as a module for x86.

If you build it on a little-endian host, you will get the correct
MODULE_ALIAS:

    $ grep MODULE_ALIAS drivers/platform/x86/intel/ishtp_eclite.mod.c
    MODULE_ALIAS("ishtp:{6A19CC4B-D760-4DE3-B14D-F25EBD0FBCD9}");

However, if you build it on a big-endian host, you will get a wrong
MODULE_ALIAS:

    $ grep MODULE_ALIAS drivers/platform/x86/intel/ishtp_eclite.mod.c
    MODULE_ALIAS("ishtp:{BD0FBCD9-F25E-B14D-4DE3-D7606A19CC4B}");

This issue has been unnoticed because the x86 kernel is most likely built
natively on an x86 host.

The guid field must not be reversed because guid_t is an array of __u8.

Fixes: fa443bc3c1 ("HID: intel-ish-hid: add support for MODULE_DEVICE_TABLE()")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:59:28 +01:00
..
.gitignore .gitignore: prefix local generated files with a slash 2021-05-02 00:43:35 +09:00
Makefile scripts/mod: disable LTO for empty.c 2021-01-14 08:21:09 -08:00
devicetable-offsets.c vfio/cdx: add support for CDX bus 2023-06-16 12:27:04 -06:00
empty.c
file2alias.c modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host 2023-11-20 11:59:28 +01:00
list.h modpost: import include/linux/list.h 2022-05-08 03:17:00 +09:00
mk_elfconfig.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
modpost.c modpost: Don't let "driver"s reference .exit.* 2023-10-01 14:55:30 +09:00
modpost.h modpost: clean up MIPS64 little endian relocation code 2023-07-31 23:42:14 +09:00
sumversion.c modpost: fix array_size.cocci warning 2022-11-21 10:18:39 +09:00