Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- Fix a possible stack corruption and subsequent DLPAR failure in the
rpadlpar_io PCI hotplug driver

- Two build fixes for uncommon configurations

Thanks to Christophe Leroy and Tyrel Datwyler.

* tag 'powerpc-5.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
PCI: rpadlpar: Fix potential drc_name corruption in store functions
powerpc: Force inlining of cpu_has_feature() to avoid build failure
powerpc/vdso32: Add missing _restgpr_31_x to fix build failure

+19 -10
+2 -2
arch/powerpc/include/asm/cpu_has_feature.h
··· 7 7 #include <linux/bug.h> 8 8 #include <asm/cputable.h> 9 9 10 - static inline bool early_cpu_has_feature(unsigned long feature) 10 + static __always_inline bool early_cpu_has_feature(unsigned long feature) 11 11 { 12 12 return !!((CPU_FTRS_ALWAYS & feature) || 13 13 (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); ··· 46 46 return static_branch_likely(&cpu_feature_keys[i]); 47 47 } 48 48 #else 49 - static inline bool cpu_has_feature(unsigned long feature) 49 + static __always_inline bool cpu_has_feature(unsigned long feature) 50 50 { 51 51 return early_cpu_has_feature(feature); 52 52 }
+11
arch/powerpc/kernel/vdso32/gettimeofday.S
··· 65 65 V_FUNCTION_BEGIN(__kernel_time) 66 66 cvdso_call_time __c_kernel_time 67 67 V_FUNCTION_END(__kernel_time) 68 + 69 + /* Routines for restoring integer registers, called by the compiler. */ 70 + /* Called with r11 pointing to the stack header word of the caller of the */ 71 + /* function, just beyond the end of the integer restore area. */ 72 + _GLOBAL(_restgpr_31_x) 73 + _GLOBAL(_rest32gpr_31_x) 74 + lwz r0,4(r11) 75 + lwz r31,-4(r11) 76 + mtlr r0 77 + mr r1,r11 78 + blr
+6 -8
drivers/pci/hotplug/rpadlpar_sysfs.c
··· 34 34 if (nbytes >= MAX_DRC_NAME_LEN) 35 35 return 0; 36 36 37 - memcpy(drc_name, buf, nbytes); 37 + strscpy(drc_name, buf, nbytes + 1); 38 38 39 39 end = strchr(drc_name, '\n'); 40 - if (!end) 41 - end = &drc_name[nbytes]; 42 - *end = '\0'; 40 + if (end) 41 + *end = '\0'; 43 42 44 43 rc = dlpar_add_slot(drc_name); 45 44 if (rc) ··· 64 65 if (nbytes >= MAX_DRC_NAME_LEN) 65 66 return 0; 66 67 67 - memcpy(drc_name, buf, nbytes); 68 + strscpy(drc_name, buf, nbytes + 1); 68 69 69 70 end = strchr(drc_name, '\n'); 70 - if (!end) 71 - end = &drc_name[nbytes]; 72 - *end = '\0'; 71 + if (end) 72 + *end = '\0'; 73 73 74 74 rc = dlpar_remove_slot(drc_name); 75 75 if (rc)