linux-stable/scripts
Masahiro Yamada b54a4c8ca1 modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host
[ Upstream commit 7f54e00e58 ]

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: 0fc1db9d10 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-20 11:06:53 +01:00
..
atomic
basic
clang-tools scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
coccinelle
dtc scripts/dtc: Call pkg-config POSIXly correct 2022-04-08 14:40:15 +02:00
dummy-tools kbuild: check the minimum assembler version in Kconfig 2023-04-20 12:10:28 +02:00
gcc-plugins gcc-plugins: Reorganize gimple includes for GCC 13 2023-06-14 11:09:30 +02:00
gdb scripts/gdb: fix lx-timerlist for Python3 2023-05-17 11:48:06 +02:00
genksyms
kconfig kconfig: fix possible buffer overflow 2023-09-19 12:20:25 +02:00
ksymoops
mod modpost: fix tee MODULE_DEVICE_TABLE built on big-endian host 2023-11-20 11:06:53 +01:00
package builddeb: clean generated package content 2023-03-11 16:39:46 +01:00
selinux selinux: use "grep -E" instead of "egrep" 2022-10-26 13:25:17 +02:00
tracing ftrace/scripts: Update the instructions for ftrace-bisect.sh 2023-02-01 08:23:22 +01:00
.gitignore
adjust_autoksyms.sh
as-version.sh kbuild: Switch to 'f' variants of integrated assembler flag 2023-04-20 12:10:28 +02:00
asn1_compiler.c ASN.1: Fix check for strdup() success 2023-04-26 11:27:42 +02:00
bin2c.c
bloat-o-meter
bootgraph.pl
bpf_helpers_doc.py
cc-can-link.sh
check-sysctl-docs
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
checkpatch.pl
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch
decode_stacktrace.sh
decodecode
depmod.sh
dev-needs.sh
diffconfig scripts: handle BrokenPipeError for python scripts 2023-03-17 08:45:15 +01:00
documentation-file-ref-check
export_report.pl
extract-cert.c cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-16 09:57:17 +01:00
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-12-08 11:23:54 +01:00
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh
gen_ksymdeps.sh
get_abi.pl
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh
insert-sys-cert.c
jobserver-exec
kallsyms.c
Kbuild.include kbuild: remove the target in signal traps when interrupted 2022-10-26 13:25:43 +02:00
Kconfig.include kbuild: check the minimum assembler version in Kconfig 2023-04-20 12:10:28 +02:00
kernel-doc stddef: Introduce struct_group() helper macro 2022-11-25 17:45:54 +01:00
ld-version.sh
leaking_addresses.pl leaking_addresses: Always print a trailing newline 2021-11-18 14:03:57 +01:00
Lindent
link-vmlinux.sh kbuild: Unify options for BTF generation for vmlinux and modules 2022-10-28 12:57:12 +02:00
lld-version.sh scripts/lld-version.sh: Rewrite based on upstream ld-version.sh 2021-11-21 13:46:37 +01:00
Makefile
Makefile.asm-generic
Makefile.build x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn Makefile.extrawarn: Move -Wcast-function-type-strict to W=1 2022-10-15 07:55:50 +02:00
Makefile.gcc-plugins gcc-plugins: Undefine LATENT_ENTROPY_PLUGIN when plugin disabled for a file 2022-08-25 11:38:10 +02:00
Makefile.headersinst
Makefile.host
Makefile.kasan
Makefile.kcov
Makefile.kcsan
Makefile.lib
Makefile.modfinal
Makefile.modinst
Makefile.modpost kbuild: Fix include path in scripts/Makefile.modpost 2022-09-05 10:28:55 +02:00
Makefile.modsign
Makefile.package
Makefile.ubsan ubsan: remove CONFIG_UBSAN_OBJECT_SIZE 2022-04-13 21:01:10 +02:00
Makefile.userprogs
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap mksysmap: Fix the mismatch of 'L0' symbols in System.map 2022-09-23 14:17:00 +02:00
mkuboot.sh
module.lds.S modules: Ensure natural alignment for .altinstructions and __bug_table sections 2022-08-25 11:38:19 +02:00
modules-check.sh
nsdeps
objdiff
pahole-flags.sh kbuild: Add skip_encoding_btf_enum64 option to pahole 2022-10-28 12:57:12 +02:00
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix memory leaks in the uwrite function 2023-05-30 12:57:50 +01:00
recordmcount.h
recordmcount.pl recordmcount.pl: fix typo in s390 mcount regex 2022-01-05 12:40:29 +01:00
setlocalversion
show_delta
sign-file.c cert host tools: Stop complaining about deprecated OpenSSL functions 2022-11-16 09:57:17 +01:00
sorttable.c
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt
sphinx-pre-install scripts: sphinx-pre-install: Fix ctex support on Debian 2022-01-27 10:54:36 +01:00
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: Resolve gtags empty index generation 2023-07-27 08:43:31 +02:00
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh