diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2023-10-08 02:04:44 +0900 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-10-18 17:16:09 +0900 |
commit | 7f54e00e5842663c2cea501bbbdfa572c94348a3 (patch) | |
tree | 492b2c991c4a5a18b3ae2de2d4253b152873a0ce /drivers/char/ds1620.c | |
parent | a55d4aee76ca72e198a657cb471d2a3b37983072 (diff) | |
download | linux-7f54e00e5842663c2cea501bbbdfa572c94348a3.tar.gz linux-7f54e00e5842663c2cea501bbbdfa572c94348a3.tar.bz2 linux-7f54e00e5842663c2cea501bbbdfa572c94348a3.zip |
modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host
When MODULE_DEVICE_TABLE(tee, ) 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/char/hw_random/optee-rng.c
is built as a module for ARM little-endian.
If you build it on a little-endian host, you will get the correct
MODULE_ALIAS:
$ grep MODULE_ALIAS drivers/char/hw_random/optee-rng.mod.c
MODULE_ALIAS("tee:ab7a617c-b8e7-4d8f-8301-d09b61036b64*");
However, if you build it on a big-endian host, you will get a wrong
MODULE_ALIAS:
$ grep MODULE_ALIAS drivers/char/hw_random/optee-rng.mod.c
MODULE_ALIAS("tee:646b0361-9bd0-0183-8f4d-e7b87c617aab*");
The same problem also occurs when you enable CONFIG_CPU_BIG_ENDIAN,
and build it on a little-endian host.
This issue has been unnoticed because the ARM kernel is configured for
little-endian by default, and most likely built on a little-endian host
(cross-build on x86 or native-build on ARM).
The uuid field must not be reversed because uuid_t is an array of __u8.
Fixes: 0fc1db9d1059 ("tee: add bus driver framework for TEE based devices")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Diffstat (limited to 'drivers/char/ds1620.c')
0 files changed, 0 insertions, 0 deletions