Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 6eede06

Browse files
committed
Merge tag 'hardening-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening fixes from Kees Cook: - Remove LTO-only suffixes from promoted global function symbols (Yonghong Song) - Remove unused .text..refcount section from vmlinux.lds.h (Petr Pavlu) - Add missing __always_inline to sparc __arch_xchg() (Arnd Bergmann) - Claim maintainership of string routines * tag 'hardening-v6.5-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: sparc: mark __arch_xchg() as __always_inline MAINTAINERS: Foolishly claim maintainership of string routines kallsyms: strip LTO-only suffixes from promoted global functions vmlinux.lds.h: Remove a reference to no longer used sections .text..refcount
2 parents 4b4eef5 + ec7633d commit 6eede06

File tree

6 files changed

+11
-10
lines changed

6 files changed

+11
-10
lines changed

MAINTAINERS

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8679,8 +8679,11 @@ S: Maintained
86798679
F: drivers/input/touchscreen/resistive-adc-touch.c
86808680

86818681
GENERIC STRING LIBRARY
8682+
M: Kees Cook <[email protected]>
86828683
R: Andy Shevchenko <[email protected]>
8683-
S: Maintained
8684+
8685+
S: Supported
8686+
T: git git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/hardening
86848687
F: include/linux/string.h
86858688
F: include/linux/string_choices.h
86868689
F: include/linux/string_helpers.h

arch/sparc/include/asm/cmpxchg_32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
unsigned long __xchg_u32(volatile u32 *m, u32 new);
1616
void __xchg_called_with_bad_pointer(void);
1717

18-
static inline unsigned long __arch_xchg(unsigned long x, __volatile__ void * ptr, int size)
18+
static __always_inline unsigned long __arch_xchg(unsigned long x, __volatile__ void * ptr, int size)
1919
{
2020
switch (size) {
2121
case 4:

arch/sparc/include/asm/cmpxchg_64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ xchg16(__volatile__ unsigned short *m, unsigned short val)
8787
return (load32 & mask) >> bit_shift;
8888
}
8989

90-
static inline unsigned long
90+
static __always_inline unsigned long
9191
__arch_xchg(unsigned long x, __volatile__ void * ptr, int size)
9292
{
9393
switch (size) {

include/asm-generic/vmlinux.lds.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@
578578
*(.text.unlikely .text.unlikely.*) \
579579
*(.text.unknown .text.unknown.*) \
580580
NOINSTR_TEXT \
581-
*(.text..refcount) \
582581
*(.ref.text) \
583582
*(.text.asan.* .text.tsan.*) \
584583
MEM_KEEP(init.text*) \

kernel/kallsyms.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,10 @@ static bool cleanup_symbol_name(char *s)
174174
* LLVM appends various suffixes for local functions and variables that
175175
* must be promoted to global scope as part of LTO. This can break
176176
* hooking of static functions with kprobes. '.' is not a valid
177-
* character in an identifier in C. Suffixes observed:
177+
* character in an identifier in C. Suffixes only in LLVM LTO observed:
178178
* - foo.llvm.[0-9a-f]+
179-
* - foo.[0-9a-f]+
180179
*/
181-
res = strchr(s, '.');
180+
res = strstr(s, ".llvm.");
182181
if (res) {
183182
*res = '\0';
184183
return true;

scripts/kallsyms.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,10 @@ static void cleanup_symbol_name(char *s)
349349
* ASCII[_] = 5f
350350
* ASCII[a-z] = 61,7a
351351
*
352-
* As above, replacing '.' with '\0' does not affect the main sorting,
353-
* but it helps us with subsorting.
352+
* As above, replacing the first '.' in ".llvm." with '\0' does not
353+
* affect the main sorting, but it helps us with subsorting.
354354
*/
355-
p = strchr(s, '.');
355+
p = strstr(s, ".llvm.");
356356
if (p)
357357
*p = '\0';
358358
}

0 commit comments

Comments
 (0)