Home
last modified time | relevance | path

Searched hist:56067812 (Results 1 – 5 of 5) sorted by relevance

/openbmc/linux/scripts/genksyms/
H A Dgenksyms.c56067812d5b0e737ac2063e94a50f76b810d6ca3 Fri Feb 03 03:54:05 CST 2017 Ard Biesheuvel <ard.biesheuvel@linaro.org> kbuild: modversions: add infrastructure for emitting relative CRCs

This add the kbuild infrastructure that will allow architectures to emit
vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
where the actual value is stored. This works around problems with CRCs
being mistaken for relocatable symbols on kernels that self relocate at
runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)

For the kbuild side of things, this comes down to the following:

- introducing a Kconfig symbol MODULE_REL_CRCS

- adding a -R switch to genksyms to instruct it to emit the CRC symbols
as references into the .rodata section

- making modpost distinguish such references from absolute CRC symbols
by the section index (SHN_ABS)

- making kallsyms disregard non-absolute symbols with a __crc_ prefix

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/openbmc/linux/scripts/mod/
H A Dmodpost.c4b8a5cfb5fd375cf4c7502a18f0096ed2881be27 Wed Mar 18 05:34:16 CDT 2020 Xiao Yang <yangx.jy@cn.fujitsu.com> modpost: Get proper section index by get_secindex() instead of st_shndx

(uint16_t) st_shndx is limited to 65535(i.e. SHN_XINDEX) so sym_get_data() gets
wrong section index by st_shndx if requested symbol contains extended section
index that is more than 65535. In this case, we need to get proper section index
by .symtab_shndx section.

Module.symvers generated by building kernel with "-ffunction-sections -fdata-sections"
shows the issue.

Fixes: 56067812d5b0 ("kbuild: modversions: add infrastructure for emitting relative CRCs")
Fixes: e84f9fbbece1 ("modpost: refactor namespace_from_kstrtabns() to not hard-code section name")
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
54a7151b1496cddbb7a83546b7998103e98edc88 Wed Mar 27 13:12:50 CDT 2019 Fredrik Noring <noring@nocrew.org> kbuild: modversions: Fix relative CRC byte order interpretation

Fix commit 56067812d5b0 ("kbuild: modversions: add infrastructure for
emitting relative CRCs") where CRCs are interpreted in host byte order
rather than proper kernel byte order. The bug is conditional on
CONFIG_MODULE_REL_CRCS.

For example, when loading a BE module into a BE kernel compiled with a LE
system, the error "disagrees about version of symbol module_layout" is
produced. A message such as "Found checksum D7FA6856 vs module 5668FAD7"
will be given with debug enabled, which indicates an obvious endian
problem within __kcrctab within the kernel image.

The general solution is to use the macro TO_NATIVE, as is done in
similar cases throughout modpost.c. With this correction it has been
verified that a BE kernel compiled with a LE system accepts BE modules.

This change has also been verified with a LE kernel compiled with a LE
system, in which case TO_NATIVE returns its value unmodified since the
byte orders match. This is by far the common case.

Fixes: 56067812d5b0 ("kbuild: modversions: add infrastructure for emitting relative CRCs")
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Cc: stable@vger.kernel.org
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
54a7151b1496cddbb7a83546b7998103e98edc88 Wed Mar 27 13:12:50 CDT 2019 Fredrik Noring <noring@nocrew.org> kbuild: modversions: Fix relative CRC byte order interpretation

Fix commit 56067812d5b0 ("kbuild: modversions: add infrastructure for
emitting relative CRCs") where CRCs are interpreted in host byte order
rather than proper kernel byte order. The bug is conditional on
CONFIG_MODULE_REL_CRCS.

For example, when loading a BE module into a BE kernel compiled with a LE
system, the error "disagrees about version of symbol module_layout" is
produced. A message such as "Found checksum D7FA6856 vs module 5668FAD7"
will be given with debug enabled, which indicates an obvious endian
problem within __kcrctab within the kernel image.

The general solution is to use the macro TO_NATIVE, as is done in
similar cases throughout modpost.c. With this correction it has been
verified that a BE kernel compiled with a LE system accepts BE modules.

This change has also been verified with a LE kernel compiled with a LE
system, in which case TO_NATIVE returns its value unmodified since the
byte orders match. This is by far the common case.

Fixes: 56067812d5b0 ("kbuild: modversions: add infrastructure for emitting relative CRCs")
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Cc: stable@vger.kernel.org
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
56067812d5b0e737ac2063e94a50f76b810d6ca3 Fri Feb 03 03:54:05 CST 2017 Ard Biesheuvel <ard.biesheuvel@linaro.org> kbuild: modversions: add infrastructure for emitting relative CRCs

This add the kbuild infrastructure that will allow architectures to emit
vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
where the actual value is stored. This works around problems with CRCs
being mistaken for relocatable symbols on kernels that self relocate at
runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)

For the kbuild side of things, this comes down to the following:

- introducing a Kconfig symbol MODULE_REL_CRCS

- adding a -R switch to genksyms to instruct it to emit the CRC symbols
as references into the .rodata section

- making modpost distinguish such references from absolute CRC symbols
by the section index (SHN_ABS)

- making kallsyms disregard non-absolute symbols with a __crc_ prefix

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/openbmc/linux/scripts/
H A Dkallsyms.c56067812d5b0e737ac2063e94a50f76b810d6ca3 Fri Feb 03 03:54:05 CST 2017 Ard Biesheuvel <ard.biesheuvel@linaro.org> kbuild: modversions: add infrastructure for emitting relative CRCs

This add the kbuild infrastructure that will allow architectures to emit
vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
where the actual value is stored. This works around problems with CRCs
being mistaken for relocatable symbols on kernels that self relocate at
runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)

For the kbuild side of things, this comes down to the following:

- introducing a Kconfig symbol MODULE_REL_CRCS

- adding a -R switch to genksyms to instruct it to emit the CRC symbols
as references into the .rodata section

- making modpost distinguish such references from absolute CRC symbols
by the section index (SHN_ABS)

- making kallsyms disregard non-absolute symbols with a __crc_ prefix

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
H A DMakefile.build56067812d5b0e737ac2063e94a50f76b810d6ca3 Fri Feb 03 03:54:05 CST 2017 Ard Biesheuvel <ard.biesheuvel@linaro.org> kbuild: modversions: add infrastructure for emitting relative CRCs

This add the kbuild infrastructure that will allow architectures to emit
vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
where the actual value is stored. This works around problems with CRCs
being mistaken for relocatable symbols on kernels that self relocate at
runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)

For the kbuild side of things, this comes down to the following:

- introducing a Kconfig symbol MODULE_REL_CRCS

- adding a -R switch to genksyms to instruct it to emit the CRC symbols
as references into the .rodata section

- making modpost distinguish such references from absolute CRC symbols
by the section index (SHN_ABS)

- making kallsyms disregard non-absolute symbols with a __crc_ prefix

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
/openbmc/linux/init/
H A DKconfig56067812d5b0e737ac2063e94a50f76b810d6ca3 Fri Feb 03 03:54:05 CST 2017 Ard Biesheuvel <ard.biesheuvel@linaro.org> kbuild: modversions: add infrastructure for emitting relative CRCs

This add the kbuild infrastructure that will allow architectures to emit
vmlinux symbol CRCs as 32-bit offsets to another location in the kernel
where the actual value is stored. This works around problems with CRCs
being mistaken for relocatable symbols on kernels that self relocate at
runtime (i.e., powerpc with CONFIG_RELOCATABLE=y)

For the kbuild side of things, this comes down to the following:

- introducing a Kconfig symbol MODULE_REL_CRCS

- adding a -R switch to genksyms to instruct it to emit the CRC symbols
as references into the .rodata section

- making modpost distinguish such references from absolute CRC symbols
by the section index (SHN_ABS)

- making kallsyms disregard non-absolute symbols with a __crc_ prefix

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>