Commit Graph

722 Commits

Author SHA1 Message Date
Bruce Ashfield
2666266f60 This is the 6.6.70 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmd/wdQACgkQONu9yGCS
 aT4NgxAAkMrNwZMihq/JZqh3KAvK7a6eLcy3kKvBXk5XHXRNf3lwdc5MAxHi37iS
 6xtMJ8RLN9H87xL38PECU1e+Dgt5gVURaGYvxmX+p4VCeoVK9znCRLinD7LPQw1C
 zWFS3ohBgLssLV7rfE7jQbIh4Eo/yyOI8JEj2/jtM6ttNwfEv5z3Nb9YfGfVUB00
 5/sT6CVPnG6wEXsK0Ajj8fg7pBk7aLPRD0382VtLAaNA06Mn9GuQ5ftUu6/4YYRe
 GZ3ACIaJxRhG/Rmt+/RmrOvd9FysNG8dT1Ur07TSuTGNbOOz/U7zNowdb1ZgKUJF
 hMyNgMbQSrX/5WOwgeDHJKPCMHfagWVScqzvHIAJyNjSHHkRFR8jSnmRYxQEr7u/
 wgwZfh/NTG9cvUoMVsoWoADVmhlefkFi86cEOOeaFCwkiiOOFXQi8OCHc5mq2l3O
 6VSEFZC1wLlnG2DpF63Pz4L7PXWKczD7Sum69hP2fVbWPVolD9COGHJrj4vooO1M
 hRiFjZOb9nVRqeIsFgasCvoqh5ry3LQWwonSrbyUKm7uX7hByhrlrftIJy4UV3Ew
 ZMfE5lBMYFHcsfNJT3xyKZjpLpf8s5BXTI7kMkwn0w7qnug5p7a5wK1ZnJwP6vqf
 Jpxkmf7QnhRhXPkU2uxwO8waHd8tgI8FAdx7YgOlB3A64hzqVho=
 =oGs9
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.70' into v6.6/standard/base

This is the 6.6.70 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmd/wdQACgkQONu9yGCS
# aT4NgxAAkMrNwZMihq/JZqh3KAvK7a6eLcy3kKvBXk5XHXRNf3lwdc5MAxHi37iS
# 6xtMJ8RLN9H87xL38PECU1e+Dgt5gVURaGYvxmX+p4VCeoVK9znCRLinD7LPQw1C
# zWFS3ohBgLssLV7rfE7jQbIh4Eo/yyOI8JEj2/jtM6ttNwfEv5z3Nb9YfGfVUB00
# 5/sT6CVPnG6wEXsK0Ajj8fg7pBk7aLPRD0382VtLAaNA06Mn9GuQ5ftUu6/4YYRe
# GZ3ACIaJxRhG/Rmt+/RmrOvd9FysNG8dT1Ur07TSuTGNbOOz/U7zNowdb1ZgKUJF
# hMyNgMbQSrX/5WOwgeDHJKPCMHfagWVScqzvHIAJyNjSHHkRFR8jSnmRYxQEr7u/
# wgwZfh/NTG9cvUoMVsoWoADVmhlefkFi86cEOOeaFCwkiiOOFXQi8OCHc5mq2l3O
# 6VSEFZC1wLlnG2DpF63Pz4L7PXWKczD7Sum69hP2fVbWPVolD9COGHJrj4vooO1M
# hRiFjZOb9nVRqeIsFgasCvoqh5ry3LQWwonSrbyUKm7uX7hByhrlrftIJy4UV3Ew
# ZMfE5lBMYFHcsfNJT3xyKZjpLpf8s5BXTI7kMkwn0w7qnug5p7a5wK1ZnJwP6vqf
# Jpxkmf7QnhRhXPkU2uxwO8waHd8tgI8FAdx7YgOlB3A64hzqVho=
# =oGs9
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 09 Jan 2025 07:32:20 AM EST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2025-01-13 00:03:46 -05:00
Masahiro Yamada
bc6962f2db modpost: fix the missed iteration for the max bit in do_input()
[ Upstream commit bf36b4bf1b9a7a0015610e2f038ee84ddb085de2 ]

This loop should iterate over the range from 'min' to 'max' inclusively.
The last interation is missed.

Fixes: 1d8f430c15 ("[PATCH] Input: add modalias support")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-09 13:32:06 +01:00
Masahiro Yamada
f93e9ae0ba modpost: fix input MODULE_DEVICE_TABLE() built for 64-bit on 32-bit host
[ Upstream commit 77dc55a978 ]

When building a 64-bit kernel on a 32-bit build host, incorrect
input MODULE_ALIAS() entries may be generated.

For example, when compiling a 64-bit kernel with CONFIG_INPUT_MOUSEDEV=m
on a 64-bit build machine, you will get the correct output:

  $ grep MODULE_ALIAS drivers/input/mousedev.mod.c
  MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*110,*r*0,*1,*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*r*8,*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*14A,*r*a*0,*1,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*145,*r*a*0,*1,*18,*1C,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*110,*r*a*0,*1,*m*l*s*f*w*");

However, building the same kernel on a 32-bit machine results in
incorrect output:

  $ grep MODULE_ALIAS drivers/input/mousedev.mod.c
  MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*110,*130,*r*0,*1,*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*2,*k*r*8,*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*14A,*16A,*r*a*0,*1,*20,*21,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*145,*165,*r*a*0,*1,*18,*1C,*20,*21,*38,*3C,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*3,*k*110,*130,*r*a*0,*1,*20,*21,*m*l*s*f*w*");

A similar issue occurs with CONFIG_INPUT_JOYDEV=m. On a 64-bit build
machine, the output is:

  $ grep MODULE_ALIAS drivers/input/joydev.mod.c
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*0,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*2,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*8,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*6,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*k*120,*r*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*k*130,*r*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*k*2C0,*r*a*m*l*s*f*w*");

However, on a 32-bit machine, the output is incorrect:

  $ grep MODULE_ALIAS drivers/input/joydev.mod.c
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*0,*20,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*2,*22,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*8,*28,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*3,*k*r*a*6,*26,*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*k*11F,*13F,*r*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*k*11F,*13F,*r*a*m*l*s*f*w*");
  MODULE_ALIAS("input:b*v*p*e*-e*1,*k*2C0,*2E0,*r*a*m*l*s*f*w*");

When building a 64-bit kernel, BITS_PER_LONG is defined as 64. However,
on a 32-bit build machine, the constant 1L is a signed 32-bit value.
Left-shifting it beyond 32 bits causes wraparound, and shifting by 31
or 63 bits makes it a negative value.

The fix in commit e0e9263271 ("[PATCH] PATCH: 1 line 2.6.18 bugfix:
modpost-64bit-fix.patch") is incorrect; it only addresses cases where
a 64-bit kernel is built on a 64-bit build machine, overlooking cases
on a 32-bit build machine.

Using 1ULL ensures a 64-bit width on both 32-bit and 64-bit machines,
avoiding the wraparound issue.

Fixes: e0e9263271 ("[PATCH] PATCH: 1 line 2.6.18 bugfix: modpost-64bit-fix.patch")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bf36b4bf1b9a ("modpost: fix the missed iteration for the max bit in do_input()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-09 13:32:06 +01:00
Bruce Ashfield
77698884d2 This is the 6.6.66 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmdd1hYACgkQONu9yGCS
 aT5ZrhAAvEKoB+vlaWRhVLMwzzJ0H7V4mFlLnXP4ZfxDxPQGx0rWvsu2VK0CUWZb
 2Dc8sUSedRgNPUEPoRMIj79OXj8UCRdML4IJOTlGy8U3Ex7yuQcucRf/6VCrmErG
 1efXlLVfbiLtL3VKfsUhY6wHyAWqhTuUACj2aRRjTKRfMVJdEWL1Jwth8jx5Wgoy
 wHgwrE3UyCd2e3W1Zsyeye/y7zcviKE9R2Cpjhb5v+PZGKoRi+CH6RfC6hf19wn2
 XnhSwRxS1qVcjqKlCWq4FvTAGLaJcEg93Lk1tAFA8ZqlAi58gnNumd+5HrvFkh+m
 aGxaQsnxEmj2JHTZUG7+wl8MFuVUmsOuaneOyc9GiyLIQOx5Z7D0u2n9DSgX1vW5
 XhGpacuG0q8ixr5feQKzqaYu/bEyAPUhzl5F/BDic3lABfqGgzSPK/moSGfbvdBg
 KLULlsPFz2l42Jw9oHt0aw3aZoeBtzGcLkUVq3g4lJO+oK1pcPOkMNTDxwr2XJgs
 zaWMBMjvU+6kFVufMYC5xE21mjaID7EZm2x/vo7uILgQ6uUyzITVVIlM4vh5q5NJ
 uFWG/IaBY6KitvH+lm7z+SJUEZH84hy2Jf3RZKLkqQTvg7pVSRGM5kAnQSwUxflp
 t64bhh4v6Ot78ow1aGALGUWnSMkAIhOsmHESh7EHklc4C9q11gQ=
 =go7K
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.66' into v6.6/standard/base

This is the 6.6.66 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmdd1hYACgkQONu9yGCS
# aT5ZrhAAvEKoB+vlaWRhVLMwzzJ0H7V4mFlLnXP4ZfxDxPQGx0rWvsu2VK0CUWZb
# 2Dc8sUSedRgNPUEPoRMIj79OXj8UCRdML4IJOTlGy8U3Ex7yuQcucRf/6VCrmErG
# 1efXlLVfbiLtL3VKfsUhY6wHyAWqhTuUACj2aRRjTKRfMVJdEWL1Jwth8jx5Wgoy
# wHgwrE3UyCd2e3W1Zsyeye/y7zcviKE9R2Cpjhb5v+PZGKoRi+CH6RfC6hf19wn2
# XnhSwRxS1qVcjqKlCWq4FvTAGLaJcEg93Lk1tAFA8ZqlAi58gnNumd+5HrvFkh+m
# aGxaQsnxEmj2JHTZUG7+wl8MFuVUmsOuaneOyc9GiyLIQOx5Z7D0u2n9DSgX1vW5
# XhGpacuG0q8ixr5feQKzqaYu/bEyAPUhzl5F/BDic3lABfqGgzSPK/moSGfbvdBg
# KLULlsPFz2l42Jw9oHt0aw3aZoeBtzGcLkUVq3g4lJO+oK1pcPOkMNTDxwr2XJgs
# zaWMBMjvU+6kFVufMYC5xE21mjaID7EZm2x/vo7uILgQ6uUyzITVVIlM4vh5q5NJ
# uFWG/IaBY6KitvH+lm7z+SJUEZH84hy2Jf3RZKLkqQTvg7pVSRGM5kAnQSwUxflp
# t64bhh4v6Ot78ow1aGALGUWnSMkAIhOsmHESh7EHklc4C9q11gQ=
# =go7K
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 14 Dec 2024 02:01:42 PM EST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2024-12-16 17:59:41 -05:00
Thomas Gleixner
70d6c1bade modpost: Add .irqentry.text to OTHER_SECTIONS
commit 7912405643a14b527cd4a4f33c1d4392da900888 upstream.

The compiler can fully inline the actual handler function of an interrupt
entry into the .irqentry.text entry point. If such a function contains an
access which has an exception table entry, modpost complains about a
section mismatch:

  WARNING: vmlinux.o(__ex_table+0x447c): Section mismatch in reference ...

  The relocation at __ex_table+0x447c references section ".irqentry.text"
  which is not in the list of authorized sections.

Add .irqentry.text to OTHER_SECTIONS to cure the issue.

Reported-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org # needed for linux-5.4-y
Link: https://lore.kernel.org/all/20241128111844.GE10431@google.com/
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:59:56 +01:00
Bruce Ashfield
6ae9eb480f This is the 6.6.64 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmdWutwACgkQONu9yGCS
 aT7y9Q//RSqaYiLcxjTCR0Dv9+T/9W6PdgWZez/uMesx8otljG0JknVgd4HVrQZ8
 eb5r5mQ8iBYS2iDQZq3CbeNwoU8rVlCQmkMAm+81RAAeT9G6xHqikSz7BtLifGP1
 BpMPTr4Dy7n8H9Dkon/T8S/4Cg3wwCfJTE929LecsDy3ZaFZ8jmGh7cvnMFYaqo3
 gQRWd59h9p4kNlWtFEC4gOczr2zrCiG4vEKwINWQvRBhlpPb0ZtF1KABa525/330
 wV4MkeZea6q4cMH9QwwoxxIQQJ19GUx9doYD9uJ6tD0yaGnAPWsm7prKTW0wVJWa
 QxL+jyFZUUGN56CicI2W/ukJILgJTuTxHATXTjJzxtiiEzcBD5hdB+YZyrxNvy6d
 yCTozue8n0ulrRprlgSPcuyq+gvKlh7zadWNGKd85a3adaHPrho9HVPmphN6VzAt
 UmQvgy44hKOPNd8sOtSat8Y1giQKz4NaZ/2MT8wwCqhUjRHzVNNAz+AcHMSQDRzP
 CTcxEiInuHQyx6SLzaGrJ1sXYMxTtmWs0VbpJvSuF3oDuPudko86NcgLe6FRwYLC
 piegmHgped8MFVQ4fAAA/qXoAqgsZPyCzLsxDU3N64G2YdN7xrk4Lpc67s5UmA08
 SezsKl+hCQ+nTcZBJUpyXpdJN63Juie7idkWCYBKpi0e/vZAP4M=
 =dU5R
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.64' into v6.6/standard/base

This is the 6.6.64 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmdWutwACgkQONu9yGCS
# aT7y9Q//RSqaYiLcxjTCR0Dv9+T/9W6PdgWZez/uMesx8otljG0JknVgd4HVrQZ8
# eb5r5mQ8iBYS2iDQZq3CbeNwoU8rVlCQmkMAm+81RAAeT9G6xHqikSz7BtLifGP1
# BpMPTr4Dy7n8H9Dkon/T8S/4Cg3wwCfJTE929LecsDy3ZaFZ8jmGh7cvnMFYaqo3
# gQRWd59h9p4kNlWtFEC4gOczr2zrCiG4vEKwINWQvRBhlpPb0ZtF1KABa525/330
# wV4MkeZea6q4cMH9QwwoxxIQQJ19GUx9doYD9uJ6tD0yaGnAPWsm7prKTW0wVJWa
# QxL+jyFZUUGN56CicI2W/ukJILgJTuTxHATXTjJzxtiiEzcBD5hdB+YZyrxNvy6d
# yCTozue8n0ulrRprlgSPcuyq+gvKlh7zadWNGKd85a3adaHPrho9HVPmphN6VzAt
# UmQvgy44hKOPNd8sOtSat8Y1giQKz4NaZ/2MT8wwCqhUjRHzVNNAz+AcHMSQDRzP
# CTcxEiInuHQyx6SLzaGrJ1sXYMxTtmWs0VbpJvSuF3oDuPudko86NcgLe6FRwYLC
# piegmHgped8MFVQ4fAAA/qXoAqgsZPyCzLsxDU3N64G2YdN7xrk4Lpc67s5UmA08
# SezsKl+hCQ+nTcZBJUpyXpdJN63Juie7idkWCYBKpi0e/vZAP4M=
# =dU5R
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 09 Dec 2024 04:39:40 AM EST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2024-12-10 13:45:32 -05:00
Masahiro Yamada
fe44c54772 modpost: remove incorrect code in do_eisa_entry()
[ Upstream commit 0c3e091319e4748cb36ac9a50848903dc6f54054 ]

This function contains multiple bugs after the following commits:

 - ac55182899 ("modpost: i2c aliases need no trailing wildcard")
 - 6543becf26 ("mod/file2alias: make modalias generation safe for cross compiling")

Commit ac55182899 inserted the following code to do_eisa_entry():

    else
            strcat(alias, "*");

This is incorrect because 'alias' is uninitialized. If it is not
NULL-terminated, strcat() could cause a buffer overrun.

Even if 'alias' happens to be zero-filled, it would output:

    MODULE_ALIAS("*");

This would match anything. As a result, the module could be loaded by
any unrelated uevent from an unrelated subsystem.

Commit ac55182899 introduced another bug.            

Prior to that commit, the conditional check was:

    if (eisa->sig[0])

This checked if the first character of eisa_device_id::sig was not '\0'.

However, commit ac55182899 changed it as follows:

    if (sig[0])

sig[0] is NOT the first character of the eisa_device_id::sig. The
type of 'sig' is 'char (*)[8]', meaning that the type of 'sig[0]' is
'char [8]' instead of 'char'. 'sig[0]' and 'symval' refer to the same
address, which never becomes NULL.

The correct conversion would have been:

    if ((*sig)[0])

However, this if-conditional was meaningless because the earlier change
in commit ac551828993e was incorrect.

This commit removes the entire incorrect code, which should never have
been executed.

Fixes: ac55182899 ("modpost: i2c aliases need no trailing wildcard")
Fixes: 6543becf26 ("mod/file2alias: make modalias generation safe for cross compiling")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:59 +01:00
Masahiro Yamada
ab8c357dbf init/modpost: conditionally check section mismatch to __meminit*
[ Upstream commit 73db3abdca ]

This reverts commit eb8f689046 ("Use separate sections for __dev/
_cpu/__mem code/data").

Check section mismatch to __meminit* only when CONFIG_MEMORY_HOTPLUG=n.

With this change, the linker script and modpost become simpler, and we
can get rid of the __ref annotations from the memory hotplug code.

[sfr@canb.auug.org.au: remove MEM_KEEP from arch/powerpc/kernel/vmlinux.lds.S]
  Link: https://lkml.kernel.org/r/20240710093213.2aefb25f@canb.auug.org.au
Link: https://lkml.kernel.org/r/20240706160511.2331061-2-masahiroy@kernel.org
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Wei Yang <richard.weiyang@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:59 +01:00
Masahiro Yamada
52197a7c14 modpost: squash ALL_{INIT,EXIT}_TEXT_SECTIONS to ALL_TEXT_SECTIONS
[ Upstream commit 34fcf231dc ]

ALL_INIT_TEXT_SECTIONS and ALL_EXIT_TEXT_SECTIONS are only used in
the macro definition of ALL_TEXT_SECTIONS.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Masahiro Yamada
17f4332ae6 modpost: use ALL_INIT_SECTIONS for the section check from DATA_SECTIONS
[ Upstream commit e578e4e311 ]

ALL_INIT_SECTIONS is defined as follows:

  #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Masahiro Yamada
db081efa9b modpost: disallow the combination of EXPORT_SYMBOL and __meminit*
[ Upstream commit a3df1526da ]

Theoretically, we could export conditionally-discarded code sections,
such as .meminit*, if all the users can become modular under a certain
condition. However, that would be difficult to control and such a tricky
case has never occurred.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Masahiro Yamada
a169a023e0 modpost: remove EXIT_SECTIONS macro
[ Upstream commit 48cd8df7af ]

ALL_EXIT_SECTIONS and EXIT_SECTIONS are the same. Remove the latter.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Masahiro Yamada
2462732f35 modpost: remove MEM_INIT_SECTIONS macro
[ Upstream commit 473a45bb35 ]

ALL_XXXINIT_SECTIONS and MEM_INIT_SECTIONS are the same.
Remove the latter.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Masahiro Yamada
95da0b40fa modpost: disallow *driver to reference .meminit* sections
[ Upstream commit 50cccec15c ]

Drivers must not reference .meminit* sections, which are discarded
when CONFIG_MEMORY_HOTPLUG=n.

The reason for whitelisting "*driver" in the section mismatch check
was to allow drivers to reference symbols annotated as __devinit or
__devexit that existed in the past.

Those annotations were removed by the following commits:

 - 54b956b903 ("Remove __dev* markings from init.h")
 - 92e9e6d1f9 ("modpost.c: Stop checking __dev* section mismatches")

Remove the stale whitelist.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Masahiro Yamada
db5647420f modpost: remove ALL_EXIT_DATA_SECTIONS macro
[ Upstream commit 3ada34b0f6 ]

This is unused.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: bb43a59944f4 ("Rename .data.unlikely to .data..unlikely")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-09 10:32:58 +01:00
Bruce Ashfield
4c1fbbd1c2 This is the 6.6.35 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmZ1dGEACgkQONu9yGCS
 aT57UQ//Z/SSHM2y0LWUuvlsU8cRuZonNxr3297UQU8g/FABK5MDo3tkEAJX2WHs
 9aXLu6Tq7hEOB/60QVESCFHbiFKzBrWym91bFfdPHTyZDjEBCPEoaPuWF4060CbD
 vMpeEclaPh1ezYozU21l4c9oBOwf2SsDnkyPl78/cCQL0LXFMuzhOtlRDjqTvHAa
 0ev9gBoDyA0q7aAO2Mn52y6X1Oc4+3Wah0ZZB+xPhfzkdoaFI5l1qF5uYugOg/Am
 BCaHTeJxmslU+QBemgxNQjJ/aJg401xGjug7iVazLMLgHQgzu3iJ6M809sWKVetq
 Vl6pduKusG1ENWy1cnAF1RgZLNnFg8pWB90apoRNmzr1j61HRQGFitevlGRQNtUp
 7BC1tHKwdk70tpYYeT6gcWfSm9TfQimVX7oDVeiHiAdj4kMuk0AYKYy+hytAbkBl
 vdHKl5idYzvMKswacAxbpHpfr0uJ2O/9+MvO3fyva/pHWVPRrnRuRLTx9MALOwyz
 ftPcAKJLasrWKTnuJp2EZDufXVHRpFRSZ+znAjWibgb0X9eZAaNSkwZ5WoP4VcFN
 +t0eUZLtW0pJV6Oh0DjpfTJ3mfZODAZTfn3RA+X2wQ6qvbMB35F+Hdp9mf3pQ0rX
 TJb8llX3Xj63KBUYMRGOwQKr2/P9cL5opJ4p73jqCF7xUu5M9I8=
 =H63O
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.35' into v6.6/standard/base

This is the 6.6.35 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmZ1dGEACgkQONu9yGCS
# aT57UQ//Z/SSHM2y0LWUuvlsU8cRuZonNxr3297UQU8g/FABK5MDo3tkEAJX2WHs
# 9aXLu6Tq7hEOB/60QVESCFHbiFKzBrWym91bFfdPHTyZDjEBCPEoaPuWF4060CbD
# vMpeEclaPh1ezYozU21l4c9oBOwf2SsDnkyPl78/cCQL0LXFMuzhOtlRDjqTvHAa
# 0ev9gBoDyA0q7aAO2Mn52y6X1Oc4+3Wah0ZZB+xPhfzkdoaFI5l1qF5uYugOg/Am
# BCaHTeJxmslU+QBemgxNQjJ/aJg401xGjug7iVazLMLgHQgzu3iJ6M809sWKVetq
# Vl6pduKusG1ENWy1cnAF1RgZLNnFg8pWB90apoRNmzr1j61HRQGFitevlGRQNtUp
# 7BC1tHKwdk70tpYYeT6gcWfSm9TfQimVX7oDVeiHiAdj4kMuk0AYKYy+hytAbkBl
# vdHKl5idYzvMKswacAxbpHpfr0uJ2O/9+MvO3fyva/pHWVPRrnRuRLTx9MALOwyz
# ftPcAKJLasrWKTnuJp2EZDufXVHRpFRSZ+znAjWibgb0X9eZAaNSkwZ5WoP4VcFN
# +t0eUZLtW0pJV6Oh0DjpfTJ3mfZODAZTfn3RA+X2wQ6qvbMB35F+Hdp9mf3pQ0rX
# TJb8llX3Xj63KBUYMRGOwQKr2/P9cL5opJ4p73jqCF7xUu5M9I8=
# =H63O
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 21 Jun 2024 08:38:57 AM EDT
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2024-06-24 16:12:43 -04:00
Masahiro Yamada
6797259d9b modpost: do not warn about missing MODULE_DESCRIPTION() for vmlinux.o
[ Upstream commit 9185afeac2 ]

Building with W=1 incorrectly emits the following warning:

  WARNING: modpost: missing MODULE_DESCRIPTION() in vmlinux.o

This check should apply only to modules.

Fixes: 1fffe7a34c ("script: modpost: emit a warning when the description is missing")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-21 14:38:32 +02:00
Bruce Ashfield
4f3a41583a This is the 6.6.27 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmYaZ5IACgkQONu9yGCS
 aT497RAAuzeqn6FN8sY4O+kTBEI93FXpxjpc1CoC5+rLNbi5dOjd45KyyIG6QunK
 THOjvBctPURdO6rTc6hmWpchCdo4o5P89cOh+oxouF8YYCD2CaP50Roxh4Mw5nZ+
 bTyId7pL+/dEQArh0TMey4lToJ6CePx2q0zVRJ63DKxY1DesOSAt5RZVbiHZj7ss
 C8xDszA4wDRoM7PdYCN1ZUNiSgPWY3HpMJdG1il8WmQipqNYGLz/B/Wo4+JMMWJj
 OCy5q9VMaFoq3zIpdNDOPV7wgAXANpWKA03N2KcqvmIklNryS4vKrg3yxe40lnE1
 inBlzoEdUds+8zrS+kKyk6WBX61dYkaCD/2SJNJwfpIvK68AMEvHYHzvkut5X/g0
 0oUzp1NhQCcyxFP0wCZDHPPCJDOOxLmt1tdWoLyv4PLCgICMSrudq/630F+d3jfZ
 OyOixqOHSx6b3BGlNBxZlH/8ZeDEOsUj34QMyIk9DW6xMMXId3nCKgt01OStHG2l
 NC08IquRGNmy79/4G22zK3gbMJuzhOoVR0zN8FV5FI8ILVW5B6e58ZFoIsqUCerw
 JsceiU5+GB0lzTXEbIjuhB3AKYO+paaYMu6t+zovxLkYcZlKdZ3D8f3LHon60k68
 gFmrP1rMI19qWZbLOKTvBlvYQRWxX3UO/hDHhfbCn8su0EwwZR0=
 =NBBR
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.27' into v6.6/standard/base

This is the 6.6.27 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmYaZ5IACgkQONu9yGCS
# aT497RAAuzeqn6FN8sY4O+kTBEI93FXpxjpc1CoC5+rLNbi5dOjd45KyyIG6QunK
# THOjvBctPURdO6rTc6hmWpchCdo4o5P89cOh+oxouF8YYCD2CaP50Roxh4Mw5nZ+
# bTyId7pL+/dEQArh0TMey4lToJ6CePx2q0zVRJ63DKxY1DesOSAt5RZVbiHZj7ss
# C8xDszA4wDRoM7PdYCN1ZUNiSgPWY3HpMJdG1il8WmQipqNYGLz/B/Wo4+JMMWJj
# OCy5q9VMaFoq3zIpdNDOPV7wgAXANpWKA03N2KcqvmIklNryS4vKrg3yxe40lnE1
# inBlzoEdUds+8zrS+kKyk6WBX61dYkaCD/2SJNJwfpIvK68AMEvHYHzvkut5X/g0
# 0oUzp1NhQCcyxFP0wCZDHPPCJDOOxLmt1tdWoLyv4PLCgICMSrudq/630F+d3jfZ
# OyOixqOHSx6b3BGlNBxZlH/8ZeDEOsUj34QMyIk9DW6xMMXId3nCKgt01OStHG2l
# NC08IquRGNmy79/4G22zK3gbMJuzhOoVR0zN8FV5FI8ILVW5B6e58ZFoIsqUCerw
# JsceiU5+GB0lzTXEbIjuhB3AKYO+paaYMu6t+zovxLkYcZlKdZ3D8f3LHon60k68
# gFmrP1rMI19qWZbLOKTvBlvYQRWxX3UO/hDHhfbCn8su0EwwZR0=
# =NBBR
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat 13 Apr 2024 07:08:02 AM EDT
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2024-04-14 22:24:06 -04:00
Bruce Ashfield
4fa0bc2f53 This is the 6.6.26 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmYWo+QACgkQONu9yGCS
 aT4EyA/9HiX9wHZIjgGLLDkePE5LzfveO5R+8kqqTGQUGsgm5uMA6AO0O0Jym1xk
 zkdlsell4XqR/lw3JQEi/dDYskXN4z8qOb9yjZ8FAYa/hPaHdv8x0kUE6YG4fag8
 qzCUwozdTsmYhKVUeNfD6PJsFnMBP4x/9vYwZXsO5Fy5yKbJYD6gl5LVmK5Y6gpI
 kY9P/+39u6HGtd4zA5yHdo++CFmyLz0+QcMNm6aBkfJwCcbhzjS6MDkjilE7uumc
 AtyHieDEwGvIjPTB+j4uPaOzGFMa93k8GiACniGaXOsBV7WmH1YUbB5VpK8i282f
 peP+vnhxFhyGMwkRBXZ5KXikqG5JmpXptL4+URzGrWje7vv5Tk/nqJKP/ttgfs71
 gfFkEla14aVsfD4iVuVtmV49iVgqKKjsLv3AqBHlV4e8YolypcfuPg88PrhnetNo
 lTUrojsvMjXNQZVnzFp6z7vpdbBLjgExJ1nwsVP9S4aUDtWu6FKsDTKmyxzWielq
 m3WxNEi10T3nYx2rzD2uNqWR7YxG9tiNDhc6U410wHpaUmpmu7/AZ+rcD9ufB+0n
 XOhncKT+SxY/BXBTO3JZUq4E/lZZbnArLvV7TLUG0/w5D1XH2oGK7FWYMBF65Dtm
 MAoVPTKaMLG2dIpETJxlqI9k8wWchBUoQKN1DUtIOS8xs4CnpCY=
 =1XJZ
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.26' into v6.6/standard/base

This is the 6.6.26 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmYWo+QACgkQONu9yGCS
# aT4EyA/9HiX9wHZIjgGLLDkePE5LzfveO5R+8kqqTGQUGsgm5uMA6AO0O0Jym1xk
# zkdlsell4XqR/lw3JQEi/dDYskXN4z8qOb9yjZ8FAYa/hPaHdv8x0kUE6YG4fag8
# qzCUwozdTsmYhKVUeNfD6PJsFnMBP4x/9vYwZXsO5Fy5yKbJYD6gl5LVmK5Y6gpI
# kY9P/+39u6HGtd4zA5yHdo++CFmyLz0+QcMNm6aBkfJwCcbhzjS6MDkjilE7uumc
# AtyHieDEwGvIjPTB+j4uPaOzGFMa93k8GiACniGaXOsBV7WmH1YUbB5VpK8i282f
# peP+vnhxFhyGMwkRBXZ5KXikqG5JmpXptL4+URzGrWje7vv5Tk/nqJKP/ttgfs71
# gfFkEla14aVsfD4iVuVtmV49iVgqKKjsLv3AqBHlV4e8YolypcfuPg88PrhnetNo
# lTUrojsvMjXNQZVnzFp6z7vpdbBLjgExJ1nwsVP9S4aUDtWu6FKsDTKmyxzWielq
# m3WxNEi10T3nYx2rzD2uNqWR7YxG9tiNDhc6U410wHpaUmpmu7/AZ+rcD9ufB+0n
# XOhncKT+SxY/BXBTO3JZUq4E/lZZbnArLvV7TLUG0/w5D1XH2oGK7FWYMBF65Dtm
# MAoVPTKaMLG2dIpETJxlqI9k8wWchBUoQKN1DUtIOS8xs4CnpCY=
# =1XJZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 10 Apr 2024 10:36:20 AM EDT
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2024-04-14 22:22:03 -04:00
Max Kellermann
19e525ebbb modpost: fix null pointer dereference
[ Upstream commit 23dfd914d2 ]

If the find_fromsym() call fails and returns NULL, the warn() call
will dereference this NULL pointer and cause the program to crash.

This happened when I tried to build with "test_user_copy" module.
With this fix, it prints lots of warnings like this:

 WARNING: modpost: lib/test_user_copy: section mismatch in reference: (unknown)+0x4 (section: .text.fixup) -> (unknown) (section: .init.text)

masahiroy@kernel.org:
 The issue is reproduced with ARCH=arm allnoconfig + CONFIG_MODULES=y +
 CONFIG_RUNTIME_TESTING_MENU=y + CONFIG_TEST_USER_COPY=m

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:07:39 +02:00
Masahiro Yamada
a2671601fa modpost: do not make find_tosym() return NULL
[ Upstream commit 1102f9f85b ]

As mentioned in commit 397586506c ("modpost: Add '.ltext' and
'.ltext.*' to TEXT_SECTIONS"), modpost can result in a segmentation
fault due to a NULL pointer dereference in default_mismatch_handler().

find_tosym() can return the original symbol pointer instead of NULL
if a better one is not found.

This fixes the reported segmentation fault.

Fixes: a23e7584ec ("modpost: unify 'sym' and 'to' in default_mismatch_handler()")
Reported-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:35:47 +02:00
Jack Brennen
2bc92c61c5 modpost: Optimize symbol search from linear to binary search
[ Upstream commit 4074532758 ]

Modify modpost to use binary search for converting addresses back
into symbol references.  Previously it used linear search.

This change saves a few seconds of wall time for defconfig builds,
but can save several minutes on allyesconfigs.

Before:
$ make LLVM=1 -j128 allyesconfig vmlinux -s KCFLAGS="-Wno-error"
$ time scripts/mod/modpost -M -m -a -N -o vmlinux.symvers vmlinux.o
198.38user 1.27system 3:19.71elapsed

After:
$ make LLVM=1 -j128 allyesconfig vmlinux -s KCFLAGS="-Wno-error"
$ time scripts/mod/modpost -M -m -a -N -o vmlinux.symvers vmlinux.o
11.91user 0.85system 0:12.78elapsed

Signed-off-by: Jack Brennen <jbrennen@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Stable-dep-of: 1102f9f85b ("modpost: do not make find_tosym() return NULL")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-10 16:35:47 +02:00
Bruce Ashfield
e064a7d658 This is the 6.6.18 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmXYV4gACgkQONu9yGCS
 aT6zuA/8CbQUDlKFE+z0RUjdg6qyZUFSYOx7mD7kQE958dr9EMZ6i1DFJLPsV+Pi
 KcQPDZ7tA14K2F24bYoEnvt9o2AgsB2l5bdMKm16hJ+q2itraVWO68HEHND1HRiG
 1lKAKr0EFam8QSOUksVMPexRMrrNFH16sjmL36QvhviKpvA1OVykj83tFvDlAl7h
 5cQnSzWTi8vfXHVFJcfe/L4A1VGWmm8kKCYv1WzK1yCTopoJ1zuADPnXfYnhhY7w
 gmWhhlP3ykZ9vNDBVKAs78zRA/ITKHUv/cjK09I9z6KEWpjhj7GJaT75qu6BUpyQ
 gjkcLkesvI1ye6HMwLvBinnscO5arvn0NFyIFwjhcyMbjt3dea4IFApNlUF5UXIK
 5EaNlotpY560V3P+TYAptGeRMThskkyoG+6+AMnfZlVUUZa1khKHbJ67LVsQ0AN4
 TliY5NOrynIXHdWhjil42015i2nQyBcJwDb8gO5nn+iIxoTPKGhMQpwr9jtn3IiA
 vsUqhupUcaISMceXSt29WJbmh647SNrN0Vw21QWGiHZkzP6G1PcQpzMzz//c74I0
 nX+gBGEhjxZOf3ncW7x7eroRWUh2INVpgw+JSsZlvKHRUxJnUQoZSLuaAgsB1Mqb
 n4d01Jhnw9PekkUphGT9uNR8vWsrbSj80Sf8jC3HZqT84eYCBD0=
 =uQza
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.18' into v6.6/standard/base

This is the 6.6.18 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmXYV4gACgkQONu9yGCS
# aT6zuA/8CbQUDlKFE+z0RUjdg6qyZUFSYOx7mD7kQE958dr9EMZ6i1DFJLPsV+Pi
# KcQPDZ7tA14K2F24bYoEnvt9o2AgsB2l5bdMKm16hJ+q2itraVWO68HEHND1HRiG
# 1lKAKr0EFam8QSOUksVMPexRMrrNFH16sjmL36QvhviKpvA1OVykj83tFvDlAl7h
# 5cQnSzWTi8vfXHVFJcfe/L4A1VGWmm8kKCYv1WzK1yCTopoJ1zuADPnXfYnhhY7w
# gmWhhlP3ykZ9vNDBVKAs78zRA/ITKHUv/cjK09I9z6KEWpjhj7GJaT75qu6BUpyQ
# gjkcLkesvI1ye6HMwLvBinnscO5arvn0NFyIFwjhcyMbjt3dea4IFApNlUF5UXIK
# 5EaNlotpY560V3P+TYAptGeRMThskkyoG+6+AMnfZlVUUZa1khKHbJ67LVsQ0AN4
# TliY5NOrynIXHdWhjil42015i2nQyBcJwDb8gO5nn+iIxoTPKGhMQpwr9jtn3IiA
# vsUqhupUcaISMceXSt29WJbmh647SNrN0Vw21QWGiHZkzP6G1PcQpzMzz//c74I0
# nX+gBGEhjxZOf3ncW7x7eroRWUh2INVpgw+JSsZlvKHRUxJnUQoZSLuaAgsB1Mqb
# n4d01Jhnw9PekkUphGT9uNR8vWsrbSj80Sf8jC3HZqT84eYCBD0=
# =uQza
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 23 Feb 2024 03:30:00 AM EST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2024-02-26 15:12:37 -05:00
Nathan Chancellor
32bfb13db9 modpost: Add '.ltext' and '.ltext.*' to TEXT_SECTIONS
commit 397586506c upstream.

After the linked LLVM change, building ARCH=um defconfig results in a
segmentation fault in modpost. Prior to commit a23e7584ec ("modpost:
unify 'sym' and 'to' in default_mismatch_handler()"), there was a
warning:

  WARNING: modpost: vmlinux.o(__ex_table+0x88): Section mismatch in reference to the .ltext:(unknown)
  WARNING: modpost: The relocation at __ex_table+0x88 references
  section ".ltext" which is not in the list of
  authorized sections.  If you're adding a new section
  and/or if this reference is valid, add ".ltext" to the
  list of authorized sections to jump to on fault.
  This can be achieved by adding ".ltext" to
  OTHER_TEXT_SECTIONS in scripts/mod/modpost.c.

The linked LLVM change moves global objects to the '.ltext' (and
'.ltext.*' with '-ffunction-sections') sections with '-mcmodel=large',
which ARCH=um uses. These sections should be handled just as '.text'
and '.text.*' are, so add them to TEXT_SECTIONS.

Cc: stable@vger.kernel.org
Closes: https://github.com/ClangBuiltLinux/linux/issues/1981
Link: 4bf8a68895
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:25:03 +01:00
Masahiro Yamada
6cddb7a4d7 linux/init: remove __memexit* annotations
commit 6a4e59eeed upstream.

We have never used __memexit, __memexitdata, or __memexitconst.

These were unneeded.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-23 09:25:03 +01:00
Radek Krejci
3a9d624593 modpost: trim leading spaces when processing source files list
[ Upstream commit 5d9a16b2a4 ]

get_line() does not trim the leading spaces, but the
parse_source_files() expects to get lines with source files paths where
the first space occurs after the file path.

Fixes: 70f30cfe5b ("modpost: use read_text_file() and get_line() for reading text files")
Signed-off-by: Radek Krejci <radek.krejci@oracle.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-02-23 09:24:59 +01:00
Bruce Ashfield
a7d960cfa0 This is the 6.6.7 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmV57eoACgkQONu9yGCS
 aT6KsA//QO2JQHRZo5/YzP2j+PrQqnc9XP5wVZpM8Y46BxRx9zhJQMORnKesE5DA
 PuX4VR+ifm46VGY8JPP/JryNR3t9sQjtTfBch+DFpdG/U1WmnQywaFHBljT14/I8
 o5f/o42spTBigixpkLk9mVUbeTm9EcGR5+RfrxLbfbjMcsX6UafyJtUAo0WI6LDE
 aLZpvDgkUIwgw5Q51E8Fxc7wbg2dVib3v5dKLd20udz5YTuOqMI+n3VC5cjPiYyt
 a70CImU2JKh2zxD/+uY4PoCu4lUvCA+BVkxXfygj0/gTh+rv4KG/Ul8ethPFzAxh
 01S4gcrCE5eRJlxTwhgdQMN2jEoX0ftUuwBOU2lLGmm3ZUFuXcz/LaoRDn6MN97I
 4JT6ZDHV7eDEGyREiCXcZSgsacIt5x/uuMqQEaFsvr3r9q72RFUPyGdb/+wBDrWZ
 EsF9eQWCaRlVcJpZeCitaglC+pRFzOeznW5drVCxS1XROeV+V5DoHuG+RivVc+dc
 lt+pYKS0bn+nmZHQpRnRAxw/VLljhjmgtow399IOB5cEzA+fzVtvFjPnv3RaqGe4
 SVYAAtV41zft8rzOEo5kbly5/m6u7SVw9SqQ+xix4N/G62m3Z3KTMTsZc0okS6TH
 /LEKHag8ptj0UdDnI0kT3smp/7Z4geFtY30JQxaivSk8c+1AXeQ=
 =rvbS
 -----END PGP SIGNATURE-----

Merge tag 'v6.6.7' into v6.6/standard/base

This is the 6.6.7 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmV57eoACgkQONu9yGCS
# aT6KsA//QO2JQHRZo5/YzP2j+PrQqnc9XP5wVZpM8Y46BxRx9zhJQMORnKesE5DA
# PuX4VR+ifm46VGY8JPP/JryNR3t9sQjtTfBch+DFpdG/U1WmnQywaFHBljT14/I8
# o5f/o42spTBigixpkLk9mVUbeTm9EcGR5+RfrxLbfbjMcsX6UafyJtUAo0WI6LDE
# aLZpvDgkUIwgw5Q51E8Fxc7wbg2dVib3v5dKLd20udz5YTuOqMI+n3VC5cjPiYyt
# a70CImU2JKh2zxD/+uY4PoCu4lUvCA+BVkxXfygj0/gTh+rv4KG/Ul8ethPFzAxh
# 01S4gcrCE5eRJlxTwhgdQMN2jEoX0ftUuwBOU2lLGmm3ZUFuXcz/LaoRDn6MN97I
# 4JT6ZDHV7eDEGyREiCXcZSgsacIt5x/uuMqQEaFsvr3r9q72RFUPyGdb/+wBDrWZ
# EsF9eQWCaRlVcJpZeCitaglC+pRFzOeznW5drVCxS1XROeV+V5DoHuG+RivVc+dc
# lt+pYKS0bn+nmZHQpRnRAxw/VLljhjmgtow399IOB5cEzA+fzVtvFjPnv3RaqGe4
# SVYAAtV41zft8rzOEo5kbly5/m6u7SVw9SqQ+xix4N/G62m3Z3KTMTsZc0okS6TH
# /LEKHag8ptj0UdDnI0kT3smp/7Z4geFtY30JQxaivSk8c+1AXeQ=
# =rvbS
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 13 Dec 2023 12:46:18 PM EST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
2023-12-18 16:58:37 -05:00
Masahiro Yamada
b1205cc72b modpost: fix section mismatch message for RELA
[ Upstream commit 1c4a7587d1 ]

The section mismatch check prints a bogus symbol name on some
architectures.

[test code]

  #include <linux/init.h>

  int __initdata foo;
  int get_foo(void) { return foo; }

If you compile it with GCC for riscv or loongarch, modpost will show an
incorrect symbol name:

  WARNING: modpost: vmlinux: section mismatch in reference: get_foo+0x8 (section: .text) -> done (section: .init.data)

To get the correct symbol address, the st_value must be added.

This issue has never been noticed since commit 93684d3b80 ("kbuild:
include symbol names in section mismatch warnings") presumably because
st_value becomes zero on most architectures when the referenced symbol
is looked up. It is not true for riscv or loongarch, at least.

With this fix, modpost will show the correct symbol name:

  WARNING: modpost: vmlinux: section mismatch in reference: get_foo+0x8 (section: .text) -> foo (section: .init.data)

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:44:59 +01:00
Paul Gortmaker
83c2e0c6eb modpost: mask trivial warnings
Newer HOSTCC will complain about various stdio fcns because
they are now declared with "warn_unused_return", or because
some initializers aren't filled out with values -- trivially
assign values so we aren't overwhelmed with these warnings
once the kernel build kicks off.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2023-11-20 23:32:58 -05:00
Masahiro Yamada
106a1f3abb modpost: fix ishtp MODULE_DEVICE_TABLE built on big-endian host
[ Upstream commit ac96a15a0f ]

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
Masahiro Yamada
a073f26af7 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:59:28 +01:00
Uwe Kleine-König
f177cd0c15 modpost: Don't let "driver"s reference .exit.*
Drivers must not reference functions marked with __exit as these likely
are not available when the code is built-in.

There are few creative offenders uncovered for example in ARCH=amd64
allmodconfig builds. So only trigger the section mismatch warning for
W=1 builds.

The dual rule that drivers must not reference .init.* is implemented
since commit 0db2524523 ("modpost: don't allow *driver to reference
.init.*") which however missed that .exit.* should be handled in the
same way.

Thanks to Masahiro Yamada and Arnd Bergmann who gave valuable hints to
find this improvement.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-10-01 14:55:30 +09:00
Mauricio Faria de Oliveira
cbc3d00cf8 modpost: add missing else to the "of" check
Without this 'else' statement, an "usb" name goes into two handlers:
the first/previous 'if' statement _AND_ the for-loop over 'devtable',
but the latter is useless as it has no 'usb' device_id entry anyway.

Tested with allmodconfig before/after patch; no changes to *.mod.c:

    git checkout v6.6-rc3
    make -j$(nproc) allmodconfig
    make -j$(nproc) olddefconfig

    make -j$(nproc)
    find . -name '*.mod.c' | cpio -pd /tmp/before

    # apply patch

    make -j$(nproc)
    find . -name '*.mod.c' | cpio -pd /tmp/after

    diff -r /tmp/before/ /tmp/after/
    # no difference

Fixes: acbef7b766 ("modpost: fix module autoloading for OF devices with generic compatible property")
Signed-off-by: Mauricio Faria de Oliveira <mfo@canonical.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-10-01 14:24:34 +09:00
Linus Torvalds
847165d7c8 parisc architecture fixes and enhancements for kernel v6.6-rc2:
* fix reference to exported symbols for parisc64 [Masahiro Yamada]
 * Block-TLB (BTLB) support on 32-bit CPUs
 * sparse and build-warning fixes
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQS86RI+GtKfB8BJu973ErUQojoPXwUCZQDAAwAKCRD3ErUQojoP
 X5wDAP4jxLxuVnUCpV5hUdFoJC5lkRM2LigbWDSfDQGHaycr0QD+NerBYX8Ejo6n
 x0zHqqtBBe1fgU0QfRdwHeE7hlOiigI=
 =FDci
 -----END PGP SIGNATURE-----

Merge tag 'parisc-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc architecture fixes from Helge Deller:

 - fix reference to exported symbols for parisc64 [Masahiro Yamada]

 - Block-TLB (BTLB) support on 32-bit CPUs

 - sparse and build-warning fixes

* tag 'parisc-for-6.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  linux/export: fix reference to exported functions for parisc64
  parisc: BTLB: Initialize BTLB tables at CPU startup
  parisc: firmware: Simplify calling non-PA20 functions
  parisc: BTLB: _edata symbol has to be page aligned for BTLB support
  parisc: BTLB: Add BTLB insert and purge firmware function wrappers
  parisc: BTLB: Clear possibly existing BTLB entries
  parisc: Prepare for Block-TLB support on 32-bit kernel
  parisc: shmparam.h: Document aliasing requirements of PA-RISC
  parisc: irq: Make irq_stack_union static to avoid sparse warning
  parisc: drivers: Fix sparse warning
  parisc: iosapic.c: Fix sparse warnings
  parisc: ccio-dma: Fix sparse warnings
  parisc: sba-iommu: Fix sparse warnigs
  parisc: sba: Fix compile warning wrt list of SBA devices
  parisc: sba_iommu: Fix build warning if procfs if disabled
2023-09-13 11:35:53 -07:00
Masahiro Yamada
08700ec705 linux/export: fix reference to exported functions for parisc64
John David Anglin reported parisc has been broken since commit
ddb5cdbafa ("kbuild: generate KSYMTAB entries by modpost").

Like ia64, parisc64 uses a function descriptor. The function
references must be prefixed with P%.

Also, symbols prefixed $$ from the library have the symbol type
STT_LOPROC instead of STT_FUNC. They should be handled as functions
too.

Fixes: ddb5cdbafa ("kbuild: generate KSYMTAB entries by modpost")
Reported-by: John David Anglin <dave.anglin@bell.net>
Tested-by: John David Anglin <dave.anglin@bell.net>
Tested-by: Helge Deller <deller@gmx.de>
Closes: https://lore.kernel.org/linux-parisc/1901598a-e11d-f7dd-a5d9-9a69d06e6b6e@bell.net/T/#u
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
2023-09-12 17:42:00 +02:00
Denis Nikitin
1ef061a4e2 modpost: Skip .llvm.call-graph-profile section check
.llvm.call-graph-profile section is added by clang when the kernel is
built with profiles (e.g. -fprofile-sample-use= or -fprofile-use=).
Note that .llvm.call-graph-profile intentionally uses REL relocations
to decrease the object size, for more details see
https://reviews.llvm.org/D104080.

The section contains edge information derived from text sections,
so .llvm.call-graph-profile itself doesn't need more analysis as
the text sections have been analyzed.

This change fixes the kernel build with clang and a sample profile
which currently fails with:

"FATAL: modpost: Please add code to calculate addend for this architecture"

Signed-off-by: Denis Nikitin <denik@chromium.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Fangrui Song <maskray@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-09-01 15:58:17 +09:00
Masahiro Yamada
77f39e9344 modpost: remove ElF_Rela variables from for-loop in section_rel(a)
Remove the Elf_Rela variables used in the for-loop in section_rel().

This makes the code consistent; section_rel() only uses Elf_Rel,
section_rela() only uses Elf_Rela.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-07-31 23:42:14 +09:00
Masahiro Yamada
4732acb75f modpost: clean up MIPS64 little endian relocation code
MIPS64 little endian target has an odd encoding of r_info.

This commit makes the special handling less ugly. It is still ugly,
but #if conditionals will go away, at least.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-07-31 23:42:14 +09:00
Masahiro Yamada
71d965cf35 modpost: pass r_type to addend_*_rel()
All of addend_*_rel() need the Elf_Rela pointer just for calculating
ELF_R_TYPE(r->r_info).

You can do it on the caller to de-duplicate the code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-07-31 23:42:14 +09:00
Masahiro Yamada
a68914a534 modpost: change return type of addend_*_rel()
Now that none of addend_*_rel() returns a meaningful value (the return
value is always 0), change all of them to return the value of r_addend.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-07-31 23:42:14 +09:00
Masahiro Yamada
481461f510 linux/export.h: make <linux/export.h> independent of CONFIG_MODULES
Currently, all files with EXPORT_SYMBOL() are rebuilt when CONFIG_MODULES
is flipped due to <linux/export.h> depending on CONFIG_MODULES.

Now that modpost can make a final decision about export symbols,
<linux/export.h> does not need to make EXPORT_SYMBOL() no-op.
Instead, modpost can skip emitting KSYMTAB when CONFIG_MODULES is unset.

This commit will reduce the number of recompilation when CONFIG_MODULES
is toggled.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-07-25 00:59:32 +09:00
Linus Torvalds
ad2885979e Kbuild updates for v6.5
- Remove the deprecated rule to build *.dtbo from *.dts
 
  - Refactor section mismatch detection in modpost
 
  - Fix bogus ARM section mismatch detections
 
  - Fix error of 'make gtags' with O= option
 
  - Add Clang's target triple to KBUILD_CPPFLAGS to fix a build error with
    the latest LLVM version
 
  - Rebuild the built-in initrd when KBUILD_BUILD_TIMESTAMP is changed
 
  - Ignore more compiler-generated symbols for kallsyms
 
  - Fix 'make local*config' to handle the ${CONFIG_FOO} form in Makefiles
 
  - Enable more kernel-doc warnings with W=2
 
  - Refactor <linux/export.h> by generating KSYMTAB data by modpost
 
  - Deprecate <asm/export.h> and <asm-generic/export.h>
 
  - Remove the EXPORT_DATA_SYMBOL macro
 
  - Move the check for static EXPORT_SYMBOL back to modpost, which makes
    the build faster
 
  - Re-implement CONFIG_TRIM_UNUSED_KSYMS with one-pass algorithm
 
  - Warn missing MODULE_DESCRIPTION when building modules with W=1
 
  - Make 'make clean' robust against too long argument error
 
  - Exclude more objects from GCOV to fix CFI failures with GCOV
 
  - Allow 'make modules_install' to install modules.builtin and
    modules.builtin.modinfo even when CONFIG_MODULES is disabled
 
  - Include modules.builtin and modules.builtin.modinfo in the linux-image
    Debian package even when CONFIG_MODULES is disabled
 
  - Revive "Entering directory" logging for the latest Make version
 -----BEGIN PGP SIGNATURE-----
 
 iQJJBAABCgAzFiEEbmPs18K1szRHjPqEPYsBB53g2wYFAmSf6B0VHG1hc2FoaXJv
 eUBrZXJuZWwub3JnAAoJED2LAQed4NsGS2wP/1izzNJ/64XmQoyBDhZCbuOl7ODF
 n4wgVJnsJmRnD/RxXR/AZ0JZwQHhzpGISWQM61rVIf/RVFOB7Apx1HpmomKUUjrL
 Yc53wLfhTEizGgwttP6tusLM3RO6jkuMKhjC4rllc0tDLJ3zCcwAjSyiOQQ9PBcH
 txwAb8r4/TZUzDDCJ0d98WdhIsNDca/ISeRXKHMiIkfvHe+6yizDKu25Y4B6BL5g
 0VPJ9nVJZ+XVwRqdVR+UQoPYGZzZ/O2NqAtU7n4PpBKvFfLACILJW+aBDAz9SqN7
 RSxn1ahxwq0vrhlB9bSrQRj3N0g8zsi7/xShEZSnGLCbyxYilr5Gq8C59+QxOIJf
 5lGBwZlEgn5aWH+D9abwjEI/QOQbTI9kX09sVzweulGCN9iJlJqyIGsB0Ri0/S2R
 c/n7c8nLwnWnGF/+LXYvkrak8L9YRKori//YYf9zdvh4h1c2/0SS0nDoC29DhDru
 Am7YmhBAkJXXX3NUB2gLvtdp94GSumqefHeSJ5Sp9v/+f2Ft7ruY2ouJC81xDa4p
 nNpvolAq2txlZ9t5OU7x7DQiuCWYSws0W7PJ9FBhyHJchf21UHbcm97/HfDoU8rN
 ioLQGm+h+g6oZt8pArk45wccjkR3ydpEFDWenYbTEr2o3zLfeKigZps5uhCK3DW2
 gnVk50VNagkzrzvA
 =Rc1z
 -----END PGP SIGNATURE-----

Merge tag 'kbuild-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild updates from Masahiro Yamada:

 - Remove the deprecated rule to build *.dtbo from *.dts

 - Refactor section mismatch detection in modpost

 - Fix bogus ARM section mismatch detections

 - Fix error of 'make gtags' with O= option

 - Add Clang's target triple to KBUILD_CPPFLAGS to fix a build error
   with the latest LLVM version

 - Rebuild the built-in initrd when KBUILD_BUILD_TIMESTAMP is changed

 - Ignore more compiler-generated symbols for kallsyms

 - Fix 'make local*config' to handle the ${CONFIG_FOO} form in Makefiles

 - Enable more kernel-doc warnings with W=2

 - Refactor <linux/export.h> by generating KSYMTAB data by modpost

 - Deprecate <asm/export.h> and <asm-generic/export.h>

 - Remove the EXPORT_DATA_SYMBOL macro

 - Move the check for static EXPORT_SYMBOL back to modpost, which makes
   the build faster

 - Re-implement CONFIG_TRIM_UNUSED_KSYMS with one-pass algorithm

 - Warn missing MODULE_DESCRIPTION when building modules with W=1

 - Make 'make clean' robust against too long argument error

 - Exclude more objects from GCOV to fix CFI failures with GCOV

 - Allow 'make modules_install' to install modules.builtin and
   modules.builtin.modinfo even when CONFIG_MODULES is disabled

 - Include modules.builtin and modules.builtin.modinfo in the
   linux-image Debian package even when CONFIG_MODULES is disabled

 - Revive "Entering directory" logging for the latest Make version

* tag 'kbuild-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: (72 commits)
  modpost: define more R_ARM_* for old distributions
  kbuild: revive "Entering directory" for Make >= 4.4.1
  kbuild: set correct abs_srctree and abs_objtree for package builds
  scripts/mksysmap: Ignore prefixed KCFI symbols
  kbuild: deb-pkg: remove the CONFIG_MODULES check in buildeb
  kbuild: builddeb: always make modules_install, to install modules.builtin*
  modpost: continue even with unknown relocation type
  modpost: factor out Elf_Sym pointer calculation to section_rel()
  modpost: factor out inst location calculation to section_rel()
  kbuild: Disable GCOV for *.mod.o
  kbuild: Fix CFI failures with GCOV
  kbuild: make clean rule robust against too long argument error
  script: modpost: emit a warning when the description is missing
  kbuild: make modules_install copy modules.builtin(.modinfo)
  linux/export.h: rename 'sec' argument to 'license'
  modpost: show offset from symbol for section mismatch warnings
  modpost: merge two similar section mismatch warnings
  kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion
  modpost: use null string instead of NULL pointer for default namespace
  modpost: squash sym_update_namespace() into sym_add_exported()
  ...
2023-07-01 09:24:31 -07:00
Linus Torvalds
b25f62ccb4 VFIO updates for v6.5-rc1
- Adjust log levels for common messages. (Oleksandr Natalenko,
    Alex Williamson)
 
  - Support for dynamic MSI-X allocation. (Reinette Chatre)
 
  - Enable and report PCIe AtomicOp Completer capabilities.
    (Alex Williamson)
 
  - Cleanup Kconfigs for vfio bus drivers. (Alex Williamson)
 
  - Add support for CDX bus based devices. (Nipun Gupta)
 
  - Fix race with concurrent mdev initialization. (Eric Farman)
 -----BEGIN PGP SIGNATURE-----
 
 iQJPBAABCAA5FiEEQvbATlQL0amee4qQI5ubbjuwiyIFAmSd7QsbHGFsZXgud2ls
 bGlhbXNvbkByZWRoYXQuY29tAAoJECObm247sIsiOrcQALKcFPN5OtKQRueLaFC4
 Mjg7CkHPUGMGYa7WIXGyBtoU2DvjzQ+6uJUJplY4bKNGLK2xQqUsilyRavDfgW5Q
 fRiBEGPd6FM8QYp2X0rbYWmQtTSWCbDhj/107Pu43gSOkH3MzXiiqJehNFO7pO5Y
 Az218iiq1nO6/g6Msswowk03C1LoH41maLjsDP4CKfdl9BTaLw0tNGmXBAkF5MZR
 Q6D54nu6g20OFXDicYKaKCrB4ydy+pkp7BfFgT7IqtPQtTiAHrhgMJYrU+0IlGwx
 ukBAGbKTiK/JySs0EY6Wz3K9hnQTzHWzWlqXO/FmlILBqqEMp18AnM3RZa36GqvT
 PrM/wiKoJgp9BFCPApVyPUyok/lrDmirKxBcWgogHC9uh0q7oI3i79k0vXkKPJnp
 5IAGhvTpJC7KBIIct8eIGgVcLA6tVPXpd30iqKR61I6X9etfo+f2nwNSjx1dC3eG
 B/DnvuTWRjecNrIPUpunHnb/LZFoV/Qq3tam3MV572aMpF0lzowuOxevI5Z4TNf+
 l/u923KBAVcotRaMm1huFP2Wkd0K8UCD9zwCpXrctNoXQXtRB9DskOinkOIGT5aS
 SaepCt003BWPJ5UlOyQMGtLG1+GPYxjrjvNWryoWStomVrc+WQ6XyAxk4iVZPJBs
 kcWTa7r9RU7uiOc2VK/UOiry
 =TOvh
 -----END PGP SIGNATURE-----

Merge tag 'vfio-v6.5-rc1' of https://github.com/awilliam/linux-vfio

Pull VFIO updates from Alex Williamson:

 - Adjust log levels for common messages (Oleksandr Natalenko, Alex
   Williamson)

 - Support for dynamic MSI-X allocation (Reinette Chatre)

 - Enable and report PCIe AtomicOp Completer capabilities (Alex
   Williamson)

 - Cleanup Kconfigs for vfio bus drivers (Alex Williamson)

 - Add support for CDX bus based devices (Nipun Gupta)

 - Fix race with concurrent mdev initialization (Eric Farman)

* tag 'vfio-v6.5-rc1' of https://github.com/awilliam/linux-vfio:
  vfio/mdev: Move the compat_class initialization to module init
  vfio/cdx: add support for CDX bus
  vfio/fsl: Create Kconfig sub-menu
  vfio/platform: Cleanup Kconfig
  vfio/pci: Cleanup Kconfig
  vfio/pci-core: Add capability for AtomicOp completer support
  vfio/pci: Also demote hiding standard cap messages
  vfio/pci: Clear VFIO_IRQ_INFO_NORESIZE for MSI-X
  vfio/pci: Support dynamic MSI-X
  vfio/pci: Probe and store ability to support dynamic MSI-X
  vfio/pci: Use bitfield for struct vfio_pci_core_device flags
  vfio/pci: Update stale comment
  vfio/pci: Remove interrupt context counter
  vfio/pci: Use xarray for interrupt context storage
  vfio/pci: Move to single error path
  vfio/pci: Prepare for dynamic interrupt context storage
  vfio/pci: Remove negative check on unsigned vector
  vfio/pci: Consolidate irq cleanup on MSI/MSI-X disable
  vfio/pci: demote hiding ecap messages to debug level
2023-06-30 15:22:09 -07:00
Masahiro Yamada
f5983dab0e modpost: define more R_ARM_* for old distributions
On CentOS 7, the following build error occurs.

scripts/mod/modpost.c: In function 'addend_arm_rel':
scripts/mod/modpost.c:1312:7: error: 'R_ARM_MOVW_ABS_NC' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'?
  case R_ARM_MOVW_ABS_NC:
       ^~~~~~~~~~~~~~~~~
       R_ARM_THM_ABS5
scripts/mod/modpost.c:1312:7: note: each undeclared identifier is reported only once for each function it appears in
scripts/mod/modpost.c:1313:7: error: 'R_ARM_MOVT_ABS' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'?
  case R_ARM_MOVT_ABS:
       ^~~~~~~~~~~~~~
       R_ARM_THM_ABS5
scripts/mod/modpost.c:1326:7: error: 'R_ARM_THM_MOVW_ABS_NC' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'?
  case R_ARM_THM_MOVW_ABS_NC:
       ^~~~~~~~~~~~~~~~~~~~~
       R_ARM_THM_ABS5
scripts/mod/modpost.c:1327:7: error: 'R_ARM_THM_MOVT_ABS' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'?
  case R_ARM_THM_MOVT_ABS:
       ^~~~~~~~~~~~~~~~~~
       R_ARM_THM_ABS5

Fixes: 12ca2c67d7 ("modpost: detect section mismatch for R_ARM_{MOVW_ABS_NC,MOVT_ABS}")
Fixes: cd1824fb7a ("modpost: detect section mismatch for R_ARM_THM_{MOVW_ABS_NC,MOVT_ABS}")
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-06-29 01:36:41 +09:00
Masahiro Yamada
8e86ebefdd modpost: continue even with unknown relocation type
Currently, unknown relocation types are just skipped.

The value of r_addend is only needed to get the symbol name in case
is_valid_name(elf, sym) returns false.

Even if we do not know how to calculate r_addend, we should continue.
At worst, we will get "(unknown)" as the symbol name, but it is better
than failing to detect section mismatches.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-06-25 23:12:20 +09:00
Masahiro Yamada
8aa00e2c3d modpost: factor out Elf_Sym pointer calculation to section_rel()
Pass the Elf_Sym pointer to addend_arm_rel() as well as to
check_section_mismatch().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
2023-06-25 23:12:20 +09:00
Masahiro Yamada
b31db651f7 modpost: factor out inst location calculation to section_rel()
All the addend_*_rel() functions calculate the instruction location in
the same way.

Factor out the similar code to the caller. Squash reloc_location() too.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-06-25 23:12:20 +09:00
Vincenzo Palazzo
1fffe7a34c script: modpost: emit a warning when the description is missing
Emit a warning when the mod description is missed and only
when the W=1 is enabled.

Reported-by: Roland Kletzing <devzero@web.de>
Link: https://bugzilla.kernel.org/show_bug.cgi?id=10770
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Tested-by: Nicolas Schier <n.schier@avm.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2023-06-24 18:05:08 +09:00
Masahiro Yamada
f234627898 modpost: show offset from symbol for section mismatch warnings
Currently, modpost only shows the symbol names and section names, so it
repeats the same message if there are multiple relocations in the same
symbol. It is common the relocation spans across multiple instructions.

It is better to show the offset from the symbol.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
2023-06-22 21:21:06 +09:00
Masahiro Yamada
78dac1a229 modpost: merge two similar section mismatch warnings
In case of section mismatch, modpost shows slightly different messages.

For extable section mismatch:

 "%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n"

For the other cases:

 "%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n"

They are similar. Merge them.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
2023-06-22 21:21:06 +09:00