diff options
60 files changed, 410 insertions, 272 deletions
diff --git a/Documentation/clearing-warn-once.txt b/Documentation/clearing-warn-once.txt index 5b1f5d547be1..c68598b31428 100644 --- a/Documentation/clearing-warn-once.txt +++ b/Documentation/clearing-warn-once.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | 1 | ||
2 | WARN_ONCE / WARN_ON_ONCE only print a warning once. | 2 | WARN_ONCE / WARN_ON_ONCE / printk_once only emit a message once. |
3 | 3 | ||
4 | echo 1 > /sys/kernel/debug/clear_warn_once | 4 | echo 1 > /sys/kernel/debug/clear_warn_once |
5 | 5 | ||
diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst index c37ec7cd9c06..75d2bbe9813f 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst | |||
@@ -58,6 +58,14 @@ A raw pointer value may be printed with %p which will hash the address | |||
58 | before printing. The kernel also supports extended specifiers for printing | 58 | before printing. The kernel also supports extended specifiers for printing |
59 | pointers of different types. | 59 | pointers of different types. |
60 | 60 | ||
61 | Some of the extended specifiers print the data on the given address instead | ||
62 | of printing the address itself. In this case, the following error messages | ||
63 | might be printed instead of the unreachable information:: | ||
64 | |||
65 | (null) data on plain NULL address | ||
66 | (efault) data on invalid address | ||
67 | (einval) invalid data on a valid address | ||
68 | |||
61 | Plain Pointers | 69 | Plain Pointers |
62 | -------------- | 70 | -------------- |
63 | 71 | ||
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index 3034d6d936d2..242108439f42 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -249,7 +249,7 @@ static int pci_dac_dma_supported(struct pci_dev *dev, u64 mask) | |||
249 | ok = 0; | 249 | ok = 0; |
250 | 250 | ||
251 | /* If both conditions above are met, we are fine. */ | 251 | /* If both conditions above are met, we are fine. */ |
252 | DBGA("pci_dac_dma_supported %s from %pf\n", | 252 | DBGA("pci_dac_dma_supported %s from %ps\n", |
253 | ok ? "yes" : "no", __builtin_return_address(0)); | 253 | ok ? "yes" : "no", __builtin_return_address(0)); |
254 | 254 | ||
255 | return ok; | 255 | return ok; |
@@ -281,7 +281,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
281 | && paddr + size <= __direct_map_size) { | 281 | && paddr + size <= __direct_map_size) { |
282 | ret = paddr + __direct_map_base; | 282 | ret = paddr + __direct_map_base; |
283 | 283 | ||
284 | DBGA2("pci_map_single: [%p,%zx] -> direct %llx from %pf\n", | 284 | DBGA2("pci_map_single: [%p,%zx] -> direct %llx from %ps\n", |
285 | cpu_addr, size, ret, __builtin_return_address(0)); | 285 | cpu_addr, size, ret, __builtin_return_address(0)); |
286 | 286 | ||
287 | return ret; | 287 | return ret; |
@@ -292,7 +292,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
292 | if (dac_allowed) { | 292 | if (dac_allowed) { |
293 | ret = paddr + alpha_mv.pci_dac_offset; | 293 | ret = paddr + alpha_mv.pci_dac_offset; |
294 | 294 | ||
295 | DBGA2("pci_map_single: [%p,%zx] -> DAC %llx from %pf\n", | 295 | DBGA2("pci_map_single: [%p,%zx] -> DAC %llx from %ps\n", |
296 | cpu_addr, size, ret, __builtin_return_address(0)); | 296 | cpu_addr, size, ret, __builtin_return_address(0)); |
297 | 297 | ||
298 | return ret; | 298 | return ret; |
@@ -329,7 +329,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size, | |||
329 | ret = arena->dma_base + dma_ofs * PAGE_SIZE; | 329 | ret = arena->dma_base + dma_ofs * PAGE_SIZE; |
330 | ret += (unsigned long)cpu_addr & ~PAGE_MASK; | 330 | ret += (unsigned long)cpu_addr & ~PAGE_MASK; |
331 | 331 | ||
332 | DBGA2("pci_map_single: [%p,%zx] np %ld -> sg %llx from %pf\n", | 332 | DBGA2("pci_map_single: [%p,%zx] np %ld -> sg %llx from %ps\n", |
333 | cpu_addr, size, npages, ret, __builtin_return_address(0)); | 333 | cpu_addr, size, npages, ret, __builtin_return_address(0)); |
334 | 334 | ||
335 | return ret; | 335 | return ret; |
@@ -396,14 +396,14 @@ static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
396 | && dma_addr < __direct_map_base + __direct_map_size) { | 396 | && dma_addr < __direct_map_base + __direct_map_size) { |
397 | /* Nothing to do. */ | 397 | /* Nothing to do. */ |
398 | 398 | ||
399 | DBGA2("pci_unmap_single: direct [%llx,%zx] from %pf\n", | 399 | DBGA2("pci_unmap_single: direct [%llx,%zx] from %ps\n", |
400 | dma_addr, size, __builtin_return_address(0)); | 400 | dma_addr, size, __builtin_return_address(0)); |
401 | 401 | ||
402 | return; | 402 | return; |
403 | } | 403 | } |
404 | 404 | ||
405 | if (dma_addr > 0xffffffff) { | 405 | if (dma_addr > 0xffffffff) { |
406 | DBGA2("pci64_unmap_single: DAC [%llx,%zx] from %pf\n", | 406 | DBGA2("pci64_unmap_single: DAC [%llx,%zx] from %ps\n", |
407 | dma_addr, size, __builtin_return_address(0)); | 407 | dma_addr, size, __builtin_return_address(0)); |
408 | return; | 408 | return; |
409 | } | 409 | } |
@@ -435,7 +435,7 @@ static void alpha_pci_unmap_page(struct device *dev, dma_addr_t dma_addr, | |||
435 | 435 | ||
436 | spin_unlock_irqrestore(&arena->lock, flags); | 436 | spin_unlock_irqrestore(&arena->lock, flags); |
437 | 437 | ||
438 | DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %pf\n", | 438 | DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %ps\n", |
439 | dma_addr, size, npages, __builtin_return_address(0)); | 439 | dma_addr, size, npages, __builtin_return_address(0)); |
440 | } | 440 | } |
441 | 441 | ||
@@ -458,7 +458,7 @@ try_again: | |||
458 | cpu_addr = (void *)__get_free_pages(gfp | __GFP_ZERO, order); | 458 | cpu_addr = (void *)__get_free_pages(gfp | __GFP_ZERO, order); |
459 | if (! cpu_addr) { | 459 | if (! cpu_addr) { |
460 | printk(KERN_INFO "pci_alloc_consistent: " | 460 | printk(KERN_INFO "pci_alloc_consistent: " |
461 | "get_free_pages failed from %pf\n", | 461 | "get_free_pages failed from %ps\n", |
462 | __builtin_return_address(0)); | 462 | __builtin_return_address(0)); |
463 | /* ??? Really atomic allocation? Otherwise we could play | 463 | /* ??? Really atomic allocation? Otherwise we could play |
464 | with vmalloc and sg if we can't find contiguous memory. */ | 464 | with vmalloc and sg if we can't find contiguous memory. */ |
@@ -477,7 +477,7 @@ try_again: | |||
477 | goto try_again; | 477 | goto try_again; |
478 | } | 478 | } |
479 | 479 | ||
480 | DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %pf\n", | 480 | DBGA2("pci_alloc_consistent: %zx -> [%p,%llx] from %ps\n", |
481 | size, cpu_addr, *dma_addrp, __builtin_return_address(0)); | 481 | size, cpu_addr, *dma_addrp, __builtin_return_address(0)); |
482 | 482 | ||
483 | return cpu_addr; | 483 | return cpu_addr; |
@@ -497,7 +497,7 @@ static void alpha_pci_free_coherent(struct device *dev, size_t size, | |||
497 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); | 497 | pci_unmap_single(pdev, dma_addr, size, PCI_DMA_BIDIRECTIONAL); |
498 | free_pages((unsigned long)cpu_addr, get_order(size)); | 498 | free_pages((unsigned long)cpu_addr, get_order(size)); |
499 | 499 | ||
500 | DBGA2("pci_free_consistent: [%llx,%zx] from %pf\n", | 500 | DBGA2("pci_free_consistent: [%llx,%zx] from %ps\n", |
501 | dma_addr, size, __builtin_return_address(0)); | 501 | dma_addr, size, __builtin_return_address(0)); |
502 | } | 502 | } |
503 | 503 | ||
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index 87f45b926c78..e67e0b2d4ce0 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c | |||
@@ -631,7 +631,7 @@ static void imx6_pm_stby_poweroff(void) | |||
631 | static int imx6_pm_stby_poweroff_probe(void) | 631 | static int imx6_pm_stby_poweroff_probe(void) |
632 | { | 632 | { |
633 | if (pm_power_off) { | 633 | if (pm_power_off) { |
634 | pr_warn("%s: pm_power_off already claimed %p %pf!\n", | 634 | pr_warn("%s: pm_power_off already claimed %p %ps!\n", |
635 | __func__, pm_power_off, pm_power_off); | 635 | __func__, pm_power_off, pm_power_off); |
636 | return -EBUSY; | 636 | return -EBUSY; |
637 | } | 637 | } |
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c index b54f8f8def36..e376883ab35b 100644 --- a/arch/arm/mm/alignment.c +++ b/arch/arm/mm/alignment.c | |||
@@ -133,7 +133,7 @@ static const char *usermode_action[] = { | |||
133 | static int alignment_proc_show(struct seq_file *m, void *v) | 133 | static int alignment_proc_show(struct seq_file *m, void *v) |
134 | { | 134 | { |
135 | seq_printf(m, "User:\t\t%lu\n", ai_user); | 135 | seq_printf(m, "User:\t\t%lu\n", ai_user); |
136 | seq_printf(m, "System:\t\t%lu (%pF)\n", ai_sys, ai_sys_last_pc); | 136 | seq_printf(m, "System:\t\t%lu (%pS)\n", ai_sys, ai_sys_last_pc); |
137 | seq_printf(m, "Skipped:\t%lu\n", ai_skipped); | 137 | seq_printf(m, "Skipped:\t%lu\n", ai_skipped); |
138 | seq_printf(m, "Half:\t\t%lu\n", ai_half); | 138 | seq_printf(m, "Half:\t\t%lu\n", ai_half); |
139 | seq_printf(m, "Word:\t\t%lu\n", ai_word); | 139 | seq_printf(m, "Word:\t\t%lu\n", ai_word); |
diff --git a/arch/arm/nwfpe/fpmodule.c b/arch/arm/nwfpe/fpmodule.c index 1365e8650843..ee34c76e6624 100644 --- a/arch/arm/nwfpe/fpmodule.c +++ b/arch/arm/nwfpe/fpmodule.c | |||
@@ -147,7 +147,7 @@ void float_raise(signed char flags) | |||
147 | #ifdef CONFIG_DEBUG_USER | 147 | #ifdef CONFIG_DEBUG_USER |
148 | if (flags & debug) | 148 | if (flags & debug) |
149 | printk(KERN_DEBUG | 149 | printk(KERN_DEBUG |
150 | "NWFPE: %s[%d] takes exception %08x at %pf from %08lx\n", | 150 | "NWFPE: %s[%d] takes exception %08x at %ps from %08lx\n", |
151 | current->comm, current->pid, flags, | 151 | current->comm, current->pid, flags, |
152 | __builtin_return_address(0), GET_USERREG()->ARM_pc); | 152 | __builtin_return_address(0), GET_USERREG()->ARM_pc); |
153 | #endif | 153 | #endif |
diff --git a/arch/microblaze/mm/pgtable.c b/arch/microblaze/mm/pgtable.c index c2ce1e42b888..8fe54fda31dc 100644 --- a/arch/microblaze/mm/pgtable.c +++ b/arch/microblaze/mm/pgtable.c | |||
@@ -75,7 +75,7 @@ static void __iomem *__ioremap(phys_addr_t addr, unsigned long size, | |||
75 | p >= memory_start && p < virt_to_phys(high_memory) && | 75 | p >= memory_start && p < virt_to_phys(high_memory) && |
76 | !(p >= __virt_to_phys((phys_addr_t)__bss_stop) && | 76 | !(p >= __virt_to_phys((phys_addr_t)__bss_stop) && |
77 | p < __virt_to_phys((phys_addr_t)__bss_stop))) { | 77 | p < __virt_to_phys((phys_addr_t)__bss_stop))) { |
78 | pr_warn("__ioremap(): phys addr "PTE_FMT" is RAM lr %pf\n", | 78 | pr_warn("__ioremap(): phys addr "PTE_FMT" is RAM lr %ps\n", |
79 | (unsigned long)p, __builtin_return_address(0)); | 79 | (unsigned long)p, __builtin_return_address(0)); |
80 | return NULL; | 80 | return NULL; |
81 | } | 81 | } |
diff --git a/arch/sparc/kernel/ds.c b/arch/sparc/kernel/ds.c index f87265afb175..cad08ccce625 100644 --- a/arch/sparc/kernel/ds.c +++ b/arch/sparc/kernel/ds.c | |||
@@ -876,7 +876,7 @@ void ldom_power_off(void) | |||
876 | 876 | ||
877 | static void ds_conn_reset(struct ds_info *dp) | 877 | static void ds_conn_reset(struct ds_info *dp) |
878 | { | 878 | { |
879 | printk(KERN_ERR "ds-%llu: ds_conn_reset() from %pf\n", | 879 | printk(KERN_ERR "ds-%llu: ds_conn_reset() from %ps\n", |
880 | dp->id, __builtin_return_address(0)); | 880 | dp->id, __builtin_return_address(0)); |
881 | } | 881 | } |
882 | 882 | ||
diff --git a/arch/um/kernel/sysrq.c b/arch/um/kernel/sysrq.c index 6b995e870d55..05585eef11d9 100644 --- a/arch/um/kernel/sysrq.c +++ b/arch/um/kernel/sysrq.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | static void _print_addr(void *data, unsigned long address, int reliable) | 21 | static void _print_addr(void *data, unsigned long address, int reliable) |
22 | { | 22 | { |
23 | pr_info(" [<%08lx>] %s%pF\n", address, reliable ? "" : "? ", | 23 | pr_info(" [<%08lx>] %s%pS\n", address, reliable ? "" : "? ", |
24 | (void *)address); | 24 | (void *)address); |
25 | } | 25 | } |
26 | 26 | ||
diff --git a/arch/x86/include/asm/trace/exceptions.h b/arch/x86/include/asm/trace/exceptions.h index e0e6d7f21399..6b1e87194809 100644 --- a/arch/x86/include/asm/trace/exceptions.h +++ b/arch/x86/include/asm/trace/exceptions.h | |||
@@ -30,7 +30,7 @@ DECLARE_EVENT_CLASS(x86_exceptions, | |||
30 | __entry->error_code = error_code; | 30 | __entry->error_code = error_code; |
31 | ), | 31 | ), |
32 | 32 | ||
33 | TP_printk("address=%pf ip=%pf error_code=0x%lx", | 33 | TP_printk("address=%ps ip=%ps error_code=0x%lx", |
34 | (void *)__entry->address, (void *)__entry->ip, | 34 | (void *)__entry->address, (void *)__entry->ip, |
35 | __entry->error_code) ); | 35 | __entry->error_code) ); |
36 | 36 | ||
diff --git a/arch/x86/mm/extable.c b/arch/x86/mm/extable.c index 3c4568f8fb28..b0a2de8d2f9e 100644 --- a/arch/x86/mm/extable.c +++ b/arch/x86/mm/extable.c | |||
@@ -145,7 +145,7 @@ __visible bool ex_handler_rdmsr_unsafe(const struct exception_table_entry *fixup | |||
145 | unsigned long error_code, | 145 | unsigned long error_code, |
146 | unsigned long fault_addr) | 146 | unsigned long fault_addr) |
147 | { | 147 | { |
148 | if (pr_warn_once("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pF)\n", | 148 | if (pr_warn_once("unchecked MSR access error: RDMSR from 0x%x at rIP: 0x%lx (%pS)\n", |
149 | (unsigned int)regs->cx, regs->ip, (void *)regs->ip)) | 149 | (unsigned int)regs->cx, regs->ip, (void *)regs->ip)) |
150 | show_stack_regs(regs); | 150 | show_stack_regs(regs); |
151 | 151 | ||
@@ -162,7 +162,7 @@ __visible bool ex_handler_wrmsr_unsafe(const struct exception_table_entry *fixup | |||
162 | unsigned long error_code, | 162 | unsigned long error_code, |
163 | unsigned long fault_addr) | 163 | unsigned long fault_addr) |
164 | { | 164 | { |
165 | if (pr_warn_once("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pF)\n", | 165 | if (pr_warn_once("unchecked MSR access error: WRMSR to 0x%x (tried to write 0x%08x%08x) at rIP: 0x%lx (%pS)\n", |
166 | (unsigned int)regs->cx, (unsigned int)regs->dx, | 166 | (unsigned int)regs->cx, (unsigned int)regs->dx, |
167 | (unsigned int)regs->ax, regs->ip, (void *)regs->ip)) | 167 | (unsigned int)regs->ax, regs->ip, (void *)regs->ip)) |
168 | show_stack_regs(regs); | 168 | show_stack_regs(regs); |
diff --git a/arch/x86/xen/multicalls.c b/arch/x86/xen/multicalls.c index 0766a08bdf45..07054572297f 100644 --- a/arch/x86/xen/multicalls.c +++ b/arch/x86/xen/multicalls.c | |||
@@ -105,7 +105,7 @@ void xen_mc_flush(void) | |||
105 | for (i = 0; i < b->mcidx; i++) { | 105 | for (i = 0; i < b->mcidx; i++) { |
106 | if (b->entries[i].result < 0) { | 106 | if (b->entries[i].result < 0) { |
107 | #if MC_DEBUG | 107 | #if MC_DEBUG |
108 | pr_err(" call %2d: op=%lu arg=[%lx] result=%ld\t%pF\n", | 108 | pr_err(" call %2d: op=%lu arg=[%lx] result=%ld\t%pS\n", |
109 | i + 1, | 109 | i + 1, |
110 | b->debug[i].op, | 110 | b->debug[i].op, |
111 | b->debug[i].args[0], | 111 | b->debug[i].args[0], |
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 5b50f884712c..b859d75eaf9f 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -414,7 +414,7 @@ static void acpi_pm_notify_handler(acpi_handle handle, u32 val, void *not_used) | |||
414 | if (adev->wakeup.flags.notifier_present) { | 414 | if (adev->wakeup.flags.notifier_present) { |
415 | pm_wakeup_ws_event(adev->wakeup.ws, 0, acpi_s2idle_wakeup()); | 415 | pm_wakeup_ws_event(adev->wakeup.ws, 0, acpi_s2idle_wakeup()); |
416 | if (adev->wakeup.context.func) { | 416 | if (adev->wakeup.context.func) { |
417 | acpi_handle_debug(handle, "Running %pF for %s\n", | 417 | acpi_handle_debug(handle, "Running %pS for %s\n", |
418 | adev->wakeup.context.func, | 418 | adev->wakeup.context.func, |
419 | dev_name(adev->wakeup.context.dev)); | 419 | dev_name(adev->wakeup.context.dev)); |
420 | adev->wakeup.context.func(&adev->wakeup.context); | 420 | adev->wakeup.context.func(&adev->wakeup.context); |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 43e863cc0c1b..10528a7747bf 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -207,7 +207,7 @@ static ktime_t initcall_debug_start(struct device *dev, void *cb) | |||
207 | if (!pm_print_times_enabled) | 207 | if (!pm_print_times_enabled) |
208 | return 0; | 208 | return 0; |
209 | 209 | ||
210 | dev_info(dev, "calling %pF @ %i, parent: %s\n", cb, | 210 | dev_info(dev, "calling %pS @ %i, parent: %s\n", cb, |
211 | task_pid_nr(current), | 211 | task_pid_nr(current), |
212 | dev->parent ? dev_name(dev->parent) : "none"); | 212 | dev->parent ? dev_name(dev->parent) : "none"); |
213 | return ktime_get(); | 213 | return ktime_get(); |
@@ -225,7 +225,7 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime, | |||
225 | rettime = ktime_get(); | 225 | rettime = ktime_get(); |
226 | nsecs = (s64) ktime_to_ns(ktime_sub(rettime, calltime)); | 226 | nsecs = (s64) ktime_to_ns(ktime_sub(rettime, calltime)); |
227 | 227 | ||
228 | dev_info(dev, "%pF returned %d after %Ld usecs\n", cb, error, | 228 | dev_info(dev, "%pS returned %d after %Ld usecs\n", cb, error, |
229 | (unsigned long long)nsecs >> 10); | 229 | (unsigned long long)nsecs >> 10); |
230 | } | 230 | } |
231 | 231 | ||
@@ -2051,7 +2051,7 @@ EXPORT_SYMBOL_GPL(dpm_suspend_start); | |||
2051 | void __suspend_report_result(const char *function, void *fn, int ret) | 2051 | void __suspend_report_result(const char *function, void *fn, int ret) |
2052 | { | 2052 | { |
2053 | if (ret) | 2053 | if (ret) |
2054 | pr_err("%s(): %pF returns %d\n", function, fn, ret); | 2054 | pr_err("%s(): %pS returns %d\n", function, fn, ret); |
2055 | } | 2055 | } |
2056 | EXPORT_SYMBOL_GPL(__suspend_report_result); | 2056 | EXPORT_SYMBOL_GPL(__suspend_report_result); |
2057 | 2057 | ||
diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index 6e076f359dcc..0d346a307140 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c | |||
@@ -62,19 +62,19 @@ int syscore_suspend(void) | |||
62 | list_for_each_entry_reverse(ops, &syscore_ops_list, node) | 62 | list_for_each_entry_reverse(ops, &syscore_ops_list, node) |
63 | if (ops->suspend) { | 63 | if (ops->suspend) { |
64 | if (initcall_debug) | 64 | if (initcall_debug) |
65 | pr_info("PM: Calling %pF\n", ops->suspend); | 65 | pr_info("PM: Calling %pS\n", ops->suspend); |
66 | ret = ops->suspend(); | 66 | ret = ops->suspend(); |
67 | if (ret) | 67 | if (ret) |
68 | goto err_out; | 68 | goto err_out; |
69 | WARN_ONCE(!irqs_disabled(), | 69 | WARN_ONCE(!irqs_disabled(), |
70 | "Interrupts enabled after %pF\n", ops->suspend); | 70 | "Interrupts enabled after %pS\n", ops->suspend); |
71 | } | 71 | } |
72 | 72 | ||
73 | trace_suspend_resume(TPS("syscore_suspend"), 0, false); | 73 | trace_suspend_resume(TPS("syscore_suspend"), 0, false); |
74 | return 0; | 74 | return 0; |
75 | 75 | ||
76 | err_out: | 76 | err_out: |
77 | pr_err("PM: System core suspend callback %pF failed.\n", ops->suspend); | 77 | pr_err("PM: System core suspend callback %pS failed.\n", ops->suspend); |
78 | 78 | ||
79 | list_for_each_entry_continue(ops, &syscore_ops_list, node) | 79 | list_for_each_entry_continue(ops, &syscore_ops_list, node) |
80 | if (ops->resume) | 80 | if (ops->resume) |
@@ -100,10 +100,10 @@ void syscore_resume(void) | |||
100 | list_for_each_entry(ops, &syscore_ops_list, node) | 100 | list_for_each_entry(ops, &syscore_ops_list, node) |
101 | if (ops->resume) { | 101 | if (ops->resume) { |
102 | if (initcall_debug) | 102 | if (initcall_debug) |
103 | pr_info("PM: Calling %pF\n", ops->resume); | 103 | pr_info("PM: Calling %pS\n", ops->resume); |
104 | ops->resume(); | 104 | ops->resume(); |
105 | WARN_ONCE(!irqs_disabled(), | 105 | WARN_ONCE(!irqs_disabled(), |
106 | "Interrupts enabled after %pF\n", ops->resume); | 106 | "Interrupts enabled after %pS\n", ops->resume); |
107 | } | 107 | } |
108 | trace_suspend_resume(TPS("syscore_resume"), 0, false); | 108 | trace_suspend_resume(TPS("syscore_resume"), 0, false); |
109 | } | 109 | } |
@@ -122,7 +122,7 @@ void syscore_shutdown(void) | |||
122 | list_for_each_entry_reverse(ops, &syscore_ops_list, node) | 122 | list_for_each_entry_reverse(ops, &syscore_ops_list, node) |
123 | if (ops->shutdown) { | 123 | if (ops->shutdown) { |
124 | if (initcall_debug) | 124 | if (initcall_debug) |
125 | pr_info("PM: Calling %pF\n", ops->shutdown); | 125 | pr_info("PM: Calling %pS\n", ops->shutdown); |
126 | ops->shutdown(); | 126 | ops->shutdown(); |
127 | } | 127 | } |
128 | 128 | ||
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 843a9b9b3d74..c850bdb6c178 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -6115,7 +6115,7 @@ int drbd_ack_receiver(struct drbd_thread *thi) | |||
6115 | 6115 | ||
6116 | err = cmd->fn(connection, &pi); | 6116 | err = cmd->fn(connection, &pi); |
6117 | if (err) { | 6117 | if (err) { |
6118 | drbd_err(connection, "%pf failed\n", cmd->fn); | 6118 | drbd_err(connection, "%ps failed\n", cmd->fn); |
6119 | goto reconnect; | 6119 | goto reconnect; |
6120 | } | 6120 | } |
6121 | 6121 | ||
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 95f608d1a098..49f89db0766f 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -1693,7 +1693,7 @@ irqreturn_t floppy_interrupt(int irq, void *dev_id) | |||
1693 | /* we don't even know which FDC is the culprit */ | 1693 | /* we don't even know which FDC is the culprit */ |
1694 | pr_info("DOR0=%x\n", fdc_state[0].dor); | 1694 | pr_info("DOR0=%x\n", fdc_state[0].dor); |
1695 | pr_info("floppy interrupt on bizarre fdc %d\n", fdc); | 1695 | pr_info("floppy interrupt on bizarre fdc %d\n", fdc); |
1696 | pr_info("handler=%pf\n", handler); | 1696 | pr_info("handler=%ps\n", handler); |
1697 | is_alive(__func__, "bizarre fdc"); | 1697 | is_alive(__func__, "bizarre fdc"); |
1698 | return IRQ_NONE; | 1698 | return IRQ_NONE; |
1699 | } | 1699 | } |
@@ -1752,7 +1752,7 @@ static void reset_interrupt(void) | |||
1752 | debugt(__func__, ""); | 1752 | debugt(__func__, ""); |
1753 | result(); /* get the status ready for set_fdc */ | 1753 | result(); /* get the status ready for set_fdc */ |
1754 | if (FDCS->reset) { | 1754 | if (FDCS->reset) { |
1755 | pr_info("reset set in interrupt, calling %pf\n", cont->error); | 1755 | pr_info("reset set in interrupt, calling %ps\n", cont->error); |
1756 | cont->error(); /* a reset just after a reset. BAD! */ | 1756 | cont->error(); /* a reset just after a reset. BAD! */ |
1757 | } | 1757 | } |
1758 | cont->redo(); | 1758 | cont->redo(); |
@@ -1793,7 +1793,7 @@ static void show_floppy(void) | |||
1793 | pr_info("\n"); | 1793 | pr_info("\n"); |
1794 | pr_info("floppy driver state\n"); | 1794 | pr_info("floppy driver state\n"); |
1795 | pr_info("-------------------\n"); | 1795 | pr_info("-------------------\n"); |
1796 | pr_info("now=%lu last interrupt=%lu diff=%lu last called handler=%pf\n", | 1796 | pr_info("now=%lu last interrupt=%lu diff=%lu last called handler=%ps\n", |
1797 | jiffies, interruptjiffies, jiffies - interruptjiffies, | 1797 | jiffies, interruptjiffies, jiffies - interruptjiffies, |
1798 | lasthandler); | 1798 | lasthandler); |
1799 | 1799 | ||
@@ -1812,9 +1812,9 @@ static void show_floppy(void) | |||
1812 | pr_info("status=%x\n", fd_inb(FD_STATUS)); | 1812 | pr_info("status=%x\n", fd_inb(FD_STATUS)); |
1813 | pr_info("fdc_busy=%lu\n", fdc_busy); | 1813 | pr_info("fdc_busy=%lu\n", fdc_busy); |
1814 | if (do_floppy) | 1814 | if (do_floppy) |
1815 | pr_info("do_floppy=%pf\n", do_floppy); | 1815 | pr_info("do_floppy=%ps\n", do_floppy); |
1816 | if (work_pending(&floppy_work)) | 1816 | if (work_pending(&floppy_work)) |
1817 | pr_info("floppy_work.func=%pf\n", floppy_work.func); | 1817 | pr_info("floppy_work.func=%ps\n", floppy_work.func); |
1818 | if (delayed_work_pending(&fd_timer)) | 1818 | if (delayed_work_pending(&fd_timer)) |
1819 | pr_info("delayed work.function=%p expires=%ld\n", | 1819 | pr_info("delayed work.function=%p expires=%ld\n", |
1820 | fd_timer.work.func, | 1820 | fd_timer.work.func, |
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 7ea217c88c2e..db779b650fce 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -466,7 +466,7 @@ static void cpufreq_list_transition_notifiers(void) | |||
466 | mutex_lock(&cpufreq_transition_notifier_list.mutex); | 466 | mutex_lock(&cpufreq_transition_notifier_list.mutex); |
467 | 467 | ||
468 | for (nb = cpufreq_transition_notifier_list.head; nb; nb = nb->next) | 468 | for (nb = cpufreq_transition_notifier_list.head; nb; nb = nb->next) |
469 | pr_info("%pF\n", nb->notifier_call); | 469 | pr_info("%pS\n", nb->notifier_call); |
470 | 470 | ||
471 | mutex_unlock(&cpufreq_transition_notifier_list.mutex); | 471 | mutex_unlock(&cpufreq_transition_notifier_list.mutex); |
472 | } | 472 | } |
diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h index dd2f73af8f2c..2d2d9ea8be4f 100644 --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h | |||
@@ -159,7 +159,7 @@ static inline void mmc_fixup_device(struct mmc_card *card, | |||
159 | (f->ext_csd_rev == EXT_CSD_REV_ANY || | 159 | (f->ext_csd_rev == EXT_CSD_REV_ANY || |
160 | f->ext_csd_rev == card->ext_csd.rev) && | 160 | f->ext_csd_rev == card->ext_csd.rev) && |
161 | rev >= f->rev_start && rev <= f->rev_end) { | 161 | rev >= f->rev_start && rev <= f->rev_end) { |
162 | dev_dbg(&card->dev, "calling %pf\n", f->vendor_fixup); | 162 | dev_dbg(&card->dev, "calling %ps\n", f->vendor_fixup); |
163 | f->vendor_fixup(card, f->data); | 163 | f->vendor_fixup(card, f->data); |
164 | } | 164 | } |
165 | } | 165 | } |
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 7bbff0af29b2..7ff684159f29 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c | |||
@@ -581,7 +581,7 @@ int __nd_driver_register(struct nd_device_driver *nd_drv, struct module *owner, | |||
581 | struct device_driver *drv = &nd_drv->drv; | 581 | struct device_driver *drv = &nd_drv->drv; |
582 | 582 | ||
583 | if (!nd_drv->type) { | 583 | if (!nd_drv->type) { |
584 | pr_debug("driver type bitmask not set (%pf)\n", | 584 | pr_debug("driver type bitmask not set (%ps)\n", |
585 | __builtin_return_address(0)); | 585 | __builtin_return_address(0)); |
586 | return -EINVAL; | 586 | return -EINVAL; |
587 | } | 587 | } |
diff --git a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c index 91b9abbf689c..ecbab2d66e38 100644 --- a/drivers/nvdimm/dimm_devs.c +++ b/drivers/nvdimm/dimm_devs.c | |||
@@ -58,7 +58,7 @@ static int validate_dimm(struct nvdimm_drvdata *ndd) | |||
58 | 58 | ||
59 | rc = nvdimm_check_config_data(ndd->dev); | 59 | rc = nvdimm_check_config_data(ndd->dev); |
60 | if (rc) | 60 | if (rc) |
61 | dev_dbg(ndd->dev, "%pf: %s error: %d\n", | 61 | dev_dbg(ndd->dev, "%ps: %s error: %d\n", |
62 | __builtin_return_address(0), __func__, rc); | 62 | __builtin_return_address(0), __func__, rc); |
63 | return rc; | 63 | return rc; |
64 | } | 64 | } |
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c index 71853befd435..cae630fe6387 100644 --- a/drivers/pci/pci-driver.c +++ b/drivers/pci/pci-driver.c | |||
@@ -578,7 +578,7 @@ static int pci_legacy_suspend(struct device *dev, pm_message_t state) | |||
578 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 | 578 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 |
579 | && pci_dev->current_state != PCI_UNKNOWN) { | 579 | && pci_dev->current_state != PCI_UNKNOWN) { |
580 | WARN_ONCE(pci_dev->current_state != prev, | 580 | WARN_ONCE(pci_dev->current_state != prev, |
581 | "PCI PM: Device state not saved by %pF\n", | 581 | "PCI PM: Device state not saved by %pS\n", |
582 | drv->suspend); | 582 | drv->suspend); |
583 | } | 583 | } |
584 | } | 584 | } |
@@ -605,7 +605,7 @@ static int pci_legacy_suspend_late(struct device *dev, pm_message_t state) | |||
605 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 | 605 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 |
606 | && pci_dev->current_state != PCI_UNKNOWN) { | 606 | && pci_dev->current_state != PCI_UNKNOWN) { |
607 | WARN_ONCE(pci_dev->current_state != prev, | 607 | WARN_ONCE(pci_dev->current_state != prev, |
608 | "PCI PM: Device state not saved by %pF\n", | 608 | "PCI PM: Device state not saved by %pS\n", |
609 | drv->suspend_late); | 609 | drv->suspend_late); |
610 | goto Fixup; | 610 | goto Fixup; |
611 | } | 611 | } |
@@ -773,7 +773,7 @@ static int pci_pm_suspend(struct device *dev) | |||
773 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 | 773 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 |
774 | && pci_dev->current_state != PCI_UNKNOWN) { | 774 | && pci_dev->current_state != PCI_UNKNOWN) { |
775 | WARN_ONCE(pci_dev->current_state != prev, | 775 | WARN_ONCE(pci_dev->current_state != prev, |
776 | "PCI PM: State of device not saved by %pF\n", | 776 | "PCI PM: State of device not saved by %pS\n", |
777 | pm->suspend); | 777 | pm->suspend); |
778 | } | 778 | } |
779 | } | 779 | } |
@@ -821,7 +821,7 @@ static int pci_pm_suspend_noirq(struct device *dev) | |||
821 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 | 821 | if (!pci_dev->state_saved && pci_dev->current_state != PCI_D0 |
822 | && pci_dev->current_state != PCI_UNKNOWN) { | 822 | && pci_dev->current_state != PCI_UNKNOWN) { |
823 | WARN_ONCE(pci_dev->current_state != prev, | 823 | WARN_ONCE(pci_dev->current_state != prev, |
824 | "PCI PM: State of device not saved by %pF\n", | 824 | "PCI PM: State of device not saved by %pS\n", |
825 | pm->suspend_noirq); | 825 | pm->suspend_noirq); |
826 | goto Fixup; | 826 | goto Fixup; |
827 | } | 827 | } |
@@ -1260,11 +1260,11 @@ static int pci_pm_runtime_suspend(struct device *dev) | |||
1260 | * log level. | 1260 | * log level. |
1261 | */ | 1261 | */ |
1262 | if (error == -EBUSY || error == -EAGAIN) { | 1262 | if (error == -EBUSY || error == -EAGAIN) { |
1263 | dev_dbg(dev, "can't suspend now (%pf returned %d)\n", | 1263 | dev_dbg(dev, "can't suspend now (%ps returned %d)\n", |
1264 | pm->runtime_suspend, error); | 1264 | pm->runtime_suspend, error); |
1265 | return error; | 1265 | return error; |
1266 | } else if (error) { | 1266 | } else if (error) { |
1267 | dev_err(dev, "can't suspend (%pf returned %d)\n", | 1267 | dev_err(dev, "can't suspend (%ps returned %d)\n", |
1268 | pm->runtime_suspend, error); | 1268 | pm->runtime_suspend, error); |
1269 | return error; | 1269 | return error; |
1270 | } | 1270 | } |
@@ -1276,7 +1276,7 @@ static int pci_pm_runtime_suspend(struct device *dev) | |||
1276 | && !pci_dev->state_saved && pci_dev->current_state != PCI_D0 | 1276 | && !pci_dev->state_saved && pci_dev->current_state != PCI_D0 |
1277 | && pci_dev->current_state != PCI_UNKNOWN) { | 1277 | && pci_dev->current_state != PCI_UNKNOWN) { |
1278 | WARN_ONCE(pci_dev->current_state != prev, | 1278 | WARN_ONCE(pci_dev->current_state != prev, |
1279 | "PCI PM: State of device not saved by %pF\n", | 1279 | "PCI PM: State of device not saved by %pS\n", |
1280 | pm->runtime_suspend); | 1280 | pm->runtime_suspend); |
1281 | return 0; | 1281 | return 0; |
1282 | } | 1282 | } |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index a077f67fe1da..eb0afc275901 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -36,7 +36,7 @@ static ktime_t fixup_debug_start(struct pci_dev *dev, | |||
36 | void (*fn)(struct pci_dev *dev)) | 36 | void (*fn)(struct pci_dev *dev)) |
37 | { | 37 | { |
38 | if (initcall_debug) | 38 | if (initcall_debug) |
39 | pci_info(dev, "calling %pF @ %i\n", fn, task_pid_nr(current)); | 39 | pci_info(dev, "calling %pS @ %i\n", fn, task_pid_nr(current)); |
40 | 40 | ||
41 | return ktime_get(); | 41 | return ktime_get(); |
42 | } | 42 | } |
@@ -51,7 +51,7 @@ static void fixup_debug_report(struct pci_dev *dev, ktime_t calltime, | |||
51 | delta = ktime_sub(rettime, calltime); | 51 | delta = ktime_sub(rettime, calltime); |
52 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; | 52 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; |
53 | if (initcall_debug || duration > 10000) | 53 | if (initcall_debug || duration > 10000) |
54 | pci_info(dev, "%pF took %lld usecs\n", fn, duration); | 54 | pci_info(dev, "%pS took %lld usecs\n", fn, duration); |
55 | } | 55 | } |
56 | 56 | ||
57 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, | 57 | static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f, |
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c index 803666ae3635..de99f371d362 100644 --- a/drivers/pnp/quirks.c +++ b/drivers/pnp/quirks.c | |||
@@ -458,7 +458,7 @@ void pnp_fixup_device(struct pnp_dev *dev) | |||
458 | for (f = pnp_fixups; *f->id; f++) { | 458 | for (f = pnp_fixups; *f->id; f++) { |
459 | if (!compare_pnp_id(dev->id, f->id)) | 459 | if (!compare_pnp_id(dev->id, f->id)) |
460 | continue; | 460 | continue; |
461 | pnp_dbg(&dev->dev, "%s: calling %pF\n", f->id, | 461 | pnp_dbg(&dev->dev, "%s: calling %pS\n", f->id, |
462 | f->quirk_function); | 462 | f->quirk_function); |
463 | f->quirk_function(dev); | 463 | f->quirk_function(dev); |
464 | } | 464 | } |
diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 465df475f753..76fd02ccbf49 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c | |||
@@ -1031,7 +1031,7 @@ static int esp_check_spur_intr(struct esp *esp) | |||
1031 | 1031 | ||
1032 | static void esp_schedule_reset(struct esp *esp) | 1032 | static void esp_schedule_reset(struct esp *esp) |
1033 | { | 1033 | { |
1034 | esp_log_reset("esp_schedule_reset() from %pf\n", | 1034 | esp_log_reset("esp_schedule_reset() from %ps\n", |
1035 | __builtin_return_address(0)); | 1035 | __builtin_return_address(0)); |
1036 | esp->flags |= ESP_FLAG_RESETTING; | 1036 | esp->flags |= ESP_FLAG_RESETTING; |
1037 | esp_event(esp, ESP_EVENT_RESET); | 1037 | esp_event(esp, ESP_EVENT_RESET); |
diff --git a/fs/btrfs/tests/free-space-tree-tests.c b/fs/btrfs/tests/free-space-tree-tests.c index 89346da890cf..f7a969b986eb 100644 --- a/fs/btrfs/tests/free-space-tree-tests.c +++ b/fs/btrfs/tests/free-space-tree-tests.c | |||
@@ -539,7 +539,7 @@ static int run_test_both_formats(test_func_t test_func, u32 sectorsize, | |||
539 | ret = run_test(test_func, 0, sectorsize, nodesize, alignment); | 539 | ret = run_test(test_func, 0, sectorsize, nodesize, alignment); |
540 | if (ret) { | 540 | if (ret) { |
541 | test_err( | 541 | test_err( |
542 | "%pf failed with extents, sectorsize=%u, nodesize=%u, alignment=%u", | 542 | "%ps failed with extents, sectorsize=%u, nodesize=%u, alignment=%u", |
543 | test_func, sectorsize, nodesize, alignment); | 543 | test_func, sectorsize, nodesize, alignment); |
544 | test_ret = ret; | 544 | test_ret = ret; |
545 | } | 545 | } |
@@ -547,7 +547,7 @@ static int run_test_both_formats(test_func_t test_func, u32 sectorsize, | |||
547 | ret = run_test(test_func, 1, sectorsize, nodesize, alignment); | 547 | ret = run_test(test_func, 1, sectorsize, nodesize, alignment); |
548 | if (ret) { | 548 | if (ret) { |
549 | test_err( | 549 | test_err( |
550 | "%pf failed with bitmaps, sectorsize=%u, nodesize=%u, alignment=%u", | 550 | "%ps failed with bitmaps, sectorsize=%u, nodesize=%u, alignment=%u", |
551 | test_func, sectorsize, nodesize, alignment); | 551 | test_func, sectorsize, nodesize, alignment); |
552 | test_ret = ret; | 552 | test_ret = ret; |
553 | } | 553 | } |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 21b0ab6bd15a..bacf5c2a8850 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -1338,7 +1338,7 @@ struct f2fs_private_dio { | |||
1338 | 1338 | ||
1339 | #ifdef CONFIG_F2FS_FAULT_INJECTION | 1339 | #ifdef CONFIG_F2FS_FAULT_INJECTION |
1340 | #define f2fs_show_injection_info(type) \ | 1340 | #define f2fs_show_injection_info(type) \ |
1341 | printk_ratelimited("%sF2FS-fs : inject %s in %s of %pF\n", \ | 1341 | printk_ratelimited("%sF2FS-fs : inject %s in %s of %pS\n", \ |
1342 | KERN_INFO, f2fs_fault_name[type], \ | 1342 | KERN_INFO, f2fs_fault_name[type], \ |
1343 | __func__, __builtin_return_address(0)) | 1343 | __func__, __builtin_return_address(0)) |
1344 | static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type) | 1344 | static inline bool time_to_inject(struct f2fs_sb_info *sbi, int type) |
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c index c60ee46f3e39..29e94e0b6d73 100644 --- a/fs/pstore/inode.c +++ b/fs/pstore/inode.c | |||
@@ -115,7 +115,7 @@ static int pstore_ftrace_seq_show(struct seq_file *s, void *v) | |||
115 | 115 | ||
116 | rec = (struct pstore_ftrace_record *)(ps->record->buf + data->off); | 116 | rec = (struct pstore_ftrace_record *)(ps->record->buf + data->off); |
117 | 117 | ||
118 | seq_printf(s, "CPU:%d ts:%llu %08lx %08lx %pf <- %pF\n", | 118 | seq_printf(s, "CPU:%d ts:%llu %08lx %08lx %ps <- %pS\n", |
119 | pstore_ftrace_decode_cpu(rec), | 119 | pstore_ftrace_decode_cpu(rec), |
120 | pstore_ftrace_read_timestamp(rec), | 120 | pstore_ftrace_read_timestamp(rec), |
121 | rec->ip, rec->parent_ip, (void *)rec->ip, | 121 | rec->ip, rec->parent_ip, (void *)rec->ip, |
diff --git a/include/linux/printk.h b/include/linux/printk.h index d7c77ed1a4cb..84ea4d094af3 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -347,7 +347,7 @@ extern int kptr_restrict; | |||
347 | #ifdef CONFIG_PRINTK | 347 | #ifdef CONFIG_PRINTK |
348 | #define printk_once(fmt, ...) \ | 348 | #define printk_once(fmt, ...) \ |
349 | ({ \ | 349 | ({ \ |
350 | static bool __print_once __read_mostly; \ | 350 | static bool __section(.data.once) __print_once; \ |
351 | bool __ret_print_once = !__print_once; \ | 351 | bool __ret_print_once = !__print_once; \ |
352 | \ | 352 | \ |
353 | if (!__print_once) { \ | 353 | if (!__print_once) { \ |
@@ -358,7 +358,7 @@ extern int kptr_restrict; | |||
358 | }) | 358 | }) |
359 | #define printk_deferred_once(fmt, ...) \ | 359 | #define printk_deferred_once(fmt, ...) \ |
360 | ({ \ | 360 | ({ \ |
361 | static bool __print_once __read_mostly; \ | 361 | static bool __section(.data.once) __print_once; \ |
362 | bool __ret_print_once = !__print_once; \ | 362 | bool __ret_print_once = !__print_once; \ |
363 | \ | 363 | \ |
364 | if (!__print_once) { \ | 364 | if (!__print_once) { \ |
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index ab1cc33adbac..b9b7465be5eb 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h | |||
@@ -1345,7 +1345,7 @@ DECLARE_EVENT_CLASS(btrfs__work, | |||
1345 | __entry->normal_work = &work->normal_work; | 1345 | __entry->normal_work = &work->normal_work; |
1346 | ), | 1346 | ), |
1347 | 1347 | ||
1348 | TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%pf ordered_func=%p " | 1348 | TP_printk_btrfs("work=%p (normal_work=%p) wq=%p func=%ps ordered_func=%p " |
1349 | "ordered_free=%p", | 1349 | "ordered_free=%p", |
1350 | __entry->work, __entry->normal_work, __entry->wq, | 1350 | __entry->work, __entry->normal_work, __entry->wq, |
1351 | __entry->func, __entry->ordered_func, __entry->ordered_free) | 1351 | __entry->func, __entry->ordered_func, __entry->ordered_free) |
diff --git a/include/trace/events/cpuhp.h b/include/trace/events/cpuhp.h index fe1d6e8cd99d..ad16f77310c6 100644 --- a/include/trace/events/cpuhp.h +++ b/include/trace/events/cpuhp.h | |||
@@ -30,7 +30,7 @@ TRACE_EVENT(cpuhp_enter, | |||
30 | __entry->fun = fun; | 30 | __entry->fun = fun; |
31 | ), | 31 | ), |
32 | 32 | ||
33 | TP_printk("cpu: %04u target: %3d step: %3d (%pf)", | 33 | TP_printk("cpu: %04u target: %3d step: %3d (%ps)", |
34 | __entry->cpu, __entry->target, __entry->idx, __entry->fun) | 34 | __entry->cpu, __entry->target, __entry->idx, __entry->fun) |
35 | ); | 35 | ); |
36 | 36 | ||
@@ -58,7 +58,7 @@ TRACE_EVENT(cpuhp_multi_enter, | |||
58 | __entry->fun = fun; | 58 | __entry->fun = fun; |
59 | ), | 59 | ), |
60 | 60 | ||
61 | TP_printk("cpu: %04u target: %3d step: %3d (%pf)", | 61 | TP_printk("cpu: %04u target: %3d step: %3d (%ps)", |
62 | __entry->cpu, __entry->target, __entry->idx, __entry->fun) | 62 | __entry->cpu, __entry->target, __entry->idx, __entry->fun) |
63 | ); | 63 | ); |
64 | 64 | ||
diff --git a/include/trace/events/preemptirq.h b/include/trace/events/preemptirq.h index 9a0d4ceeb166..95fba0471e5b 100644 --- a/include/trace/events/preemptirq.h +++ b/include/trace/events/preemptirq.h | |||
@@ -27,7 +27,7 @@ DECLARE_EVENT_CLASS(preemptirq_template, | |||
27 | __entry->parent_offs = (u32)(parent_ip - (unsigned long)_stext); | 27 | __entry->parent_offs = (u32)(parent_ip - (unsigned long)_stext); |
28 | ), | 28 | ), |
29 | 29 | ||
30 | TP_printk("caller=%pF parent=%pF", | 30 | TP_printk("caller=%pS parent=%pS", |
31 | (void *)((unsigned long)(_stext) + __entry->caller_offs), | 31 | (void *)((unsigned long)(_stext) + __entry->caller_offs), |
32 | (void *)((unsigned long)(_stext) + __entry->parent_offs)) | 32 | (void *)((unsigned long)(_stext) + __entry->parent_offs)) |
33 | ); | 33 | ); |
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index f0c4d10e614b..80339fd14c1c 100644 --- a/include/trace/events/rcu.h +++ b/include/trace/events/rcu.h | |||
@@ -491,7 +491,7 @@ TRACE_EVENT(rcu_callback, | |||
491 | __entry->qlen = qlen; | 491 | __entry->qlen = qlen; |
492 | ), | 492 | ), |
493 | 493 | ||
494 | TP_printk("%s rhp=%p func=%pf %ld/%ld", | 494 | TP_printk("%s rhp=%p func=%ps %ld/%ld", |
495 | __entry->rcuname, __entry->rhp, __entry->func, | 495 | __entry->rcuname, __entry->rhp, __entry->func, |
496 | __entry->qlen_lazy, __entry->qlen) | 496 | __entry->qlen_lazy, __entry->qlen) |
497 | ); | 497 | ); |
@@ -587,7 +587,7 @@ TRACE_EVENT(rcu_invoke_callback, | |||
587 | __entry->func = rhp->func; | 587 | __entry->func = rhp->func; |
588 | ), | 588 | ), |
589 | 589 | ||
590 | TP_printk("%s rhp=%p func=%pf", | 590 | TP_printk("%s rhp=%p func=%ps", |
591 | __entry->rcuname, __entry->rhp, __entry->func) | 591 | __entry->rcuname, __entry->rhp, __entry->func) |
592 | ); | 592 | ); |
593 | 593 | ||
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h index 7e899e635d33..f0a6f0c5549c 100644 --- a/include/trace/events/sunrpc.h +++ b/include/trace/events/sunrpc.h | |||
@@ -146,7 +146,7 @@ DECLARE_EVENT_CLASS(rpc_task_running, | |||
146 | __entry->flags = task->tk_flags; | 146 | __entry->flags = task->tk_flags; |
147 | ), | 147 | ), |
148 | 148 | ||
149 | TP_printk("task:%u@%d flags=%s runstate=%s status=%d action=%pf", | 149 | TP_printk("task:%u@%d flags=%s runstate=%s status=%d action=%ps", |
150 | __entry->task_id, __entry->client_id, | 150 | __entry->task_id, __entry->client_id, |
151 | rpc_show_task_flags(__entry->flags), | 151 | rpc_show_task_flags(__entry->flags), |
152 | rpc_show_runstate(__entry->runstate), | 152 | rpc_show_runstate(__entry->runstate), |
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index a1cb91342231..252327dbfa51 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -226,7 +226,7 @@ TRACE_EVENT(mm_shrink_slab_start, | |||
226 | __entry->priority = priority; | 226 | __entry->priority = priority; |
227 | ), | 227 | ), |
228 | 228 | ||
229 | TP_printk("%pF %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d", | 229 | TP_printk("%pS %p: nid: %d objects to shrink %ld gfp_flags %s cache items %ld delta %lld total_scan %ld priority %d", |
230 | __entry->shrink, | 230 | __entry->shrink, |
231 | __entry->shr, | 231 | __entry->shr, |
232 | __entry->nid, | 232 | __entry->nid, |
@@ -265,7 +265,7 @@ TRACE_EVENT(mm_shrink_slab_end, | |||
265 | __entry->total_scan = total_scan; | 265 | __entry->total_scan = total_scan; |
266 | ), | 266 | ), |
267 | 267 | ||
268 | TP_printk("%pF %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", | 268 | TP_printk("%pS %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", |
269 | __entry->shrink, | 269 | __entry->shrink, |
270 | __entry->shr, | 270 | __entry->shr, |
271 | __entry->nid, | 271 | __entry->nid, |
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index 9a761bc6a251..e172549283be 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h | |||
@@ -60,7 +60,7 @@ TRACE_EVENT(workqueue_queue_work, | |||
60 | __entry->cpu = pwq->pool->cpu; | 60 | __entry->cpu = pwq->pool->cpu; |
61 | ), | 61 | ), |
62 | 62 | ||
63 | TP_printk("work struct=%p function=%pf workqueue=%p req_cpu=%u cpu=%u", | 63 | TP_printk("work struct=%p function=%ps workqueue=%p req_cpu=%u cpu=%u", |
64 | __entry->work, __entry->function, __entry->workqueue, | 64 | __entry->work, __entry->function, __entry->workqueue, |
65 | __entry->req_cpu, __entry->cpu) | 65 | __entry->req_cpu, __entry->cpu) |
66 | ); | 66 | ); |
@@ -102,7 +102,7 @@ TRACE_EVENT(workqueue_execute_start, | |||
102 | __entry->function = work->func; | 102 | __entry->function = work->func; |
103 | ), | 103 | ), |
104 | 104 | ||
105 | TP_printk("work struct %p: function %pf", __entry->work, __entry->function) | 105 | TP_printk("work struct %p: function %ps", __entry->work, __entry->function) |
106 | ); | 106 | ); |
107 | 107 | ||
108 | /** | 108 | /** |
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index fdcf88bcf0ea..9a0e8af21310 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h | |||
@@ -73,7 +73,7 @@ TRACE_EVENT(xen_mc_callback, | |||
73 | __entry->fn = fn; | 73 | __entry->fn = fn; |
74 | __entry->data = data; | 74 | __entry->data = data; |
75 | ), | 75 | ), |
76 | TP_printk("callback %pf, data %p", | 76 | TP_printk("callback %ps, data %p", |
77 | __entry->fn, __entry->data) | 77 | __entry->fn, __entry->data) |
78 | ); | 78 | ); |
79 | 79 | ||
diff --git a/init/main.c b/init/main.c index 9dc2f3b4f753..efe6d62e3846 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -846,7 +846,7 @@ trace_initcall_start_cb(void *data, initcall_t fn) | |||
846 | { | 846 | { |
847 | ktime_t *calltime = (ktime_t *)data; | 847 | ktime_t *calltime = (ktime_t *)data; |
848 | 848 | ||
849 | printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current)); | 849 | printk(KERN_DEBUG "calling %pS @ %i\n", fn, task_pid_nr(current)); |
850 | *calltime = ktime_get(); | 850 | *calltime = ktime_get(); |
851 | } | 851 | } |
852 | 852 | ||
@@ -860,7 +860,7 @@ trace_initcall_finish_cb(void *data, initcall_t fn, int ret) | |||
860 | rettime = ktime_get(); | 860 | rettime = ktime_get(); |
861 | delta = ktime_sub(rettime, *calltime); | 861 | delta = ktime_sub(rettime, *calltime); |
862 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; | 862 | duration = (unsigned long long) ktime_to_ns(delta) >> 10; |
863 | printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n", | 863 | printk(KERN_DEBUG "initcall %pS returned %d after %lld usecs\n", |
864 | fn, ret, duration); | 864 | fn, ret, duration); |
865 | } | 865 | } |
866 | 866 | ||
@@ -917,7 +917,7 @@ int __init_or_module do_one_initcall(initcall_t fn) | |||
917 | strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); | 917 | strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf)); |
918 | local_irq_enable(); | 918 | local_irq_enable(); |
919 | } | 919 | } |
920 | WARN(msgbuf[0], "initcall %pF returned with %s\n", fn, msgbuf); | 920 | WARN(msgbuf[0], "initcall %pS returned with %s\n", fn, msgbuf); |
921 | 921 | ||
922 | add_latent_entropy(); | 922 | add_latent_entropy(); |
923 | return ret; | 923 | return ret; |
diff --git a/kernel/async.c b/kernel/async.c index f6bd0d9885e1..12c332e4e13e 100644 --- a/kernel/async.c +++ b/kernel/async.c | |||
@@ -119,7 +119,7 @@ static void async_run_entry_fn(struct work_struct *work) | |||
119 | 119 | ||
120 | /* 1) run (and print duration) */ | 120 | /* 1) run (and print duration) */ |
121 | if (initcall_debug && system_state < SYSTEM_RUNNING) { | 121 | if (initcall_debug && system_state < SYSTEM_RUNNING) { |
122 | pr_debug("calling %lli_%pF @ %i\n", | 122 | pr_debug("calling %lli_%pS @ %i\n", |
123 | (long long)entry->cookie, | 123 | (long long)entry->cookie, |
124 | entry->func, task_pid_nr(current)); | 124 | entry->func, task_pid_nr(current)); |
125 | calltime = ktime_get(); | 125 | calltime = ktime_get(); |
@@ -128,7 +128,7 @@ static void async_run_entry_fn(struct work_struct *work) | |||
128 | if (initcall_debug && system_state < SYSTEM_RUNNING) { | 128 | if (initcall_debug && system_state < SYSTEM_RUNNING) { |
129 | rettime = ktime_get(); | 129 | rettime = ktime_get(); |
130 | delta = ktime_sub(rettime, calltime); | 130 | delta = ktime_sub(rettime, calltime); |
131 | pr_debug("initcall %lli_%pF returned 0 after %lld usecs\n", | 131 | pr_debug("initcall %lli_%pS returned 0 after %lld usecs\n", |
132 | (long long)entry->cookie, | 132 | (long long)entry->cookie, |
133 | entry->func, | 133 | entry->func, |
134 | (long long)ktime_to_ns(delta) >> 10); | 134 | (long long)ktime_to_ns(delta) >> 10); |
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index e6a0d6be87e3..4ca7364c956d 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c | |||
@@ -2028,7 +2028,7 @@ static void handler_chain(struct uprobe *uprobe, struct pt_regs *regs) | |||
2028 | if (uc->handler) { | 2028 | if (uc->handler) { |
2029 | rc = uc->handler(uc, regs); | 2029 | rc = uc->handler(uc, regs); |
2030 | WARN(rc & ~UPROBE_HANDLER_MASK, | 2030 | WARN(rc & ~UPROBE_HANDLER_MASK, |
2031 | "bad rc=0x%x from %pf()\n", rc, uc->handler); | 2031 | "bad rc=0x%x from %ps()\n", rc, uc->handler); |
2032 | } | 2032 | } |
2033 | 2033 | ||
2034 | if (uc->ret_handler) | 2034 | if (uc->ret_handler) |
diff --git a/kernel/fail_function.c b/kernel/fail_function.c index 17f75b545f66..feb80712b913 100644 --- a/kernel/fail_function.c +++ b/kernel/fail_function.c | |||
@@ -210,7 +210,7 @@ static int fei_seq_show(struct seq_file *m, void *v) | |||
210 | { | 210 | { |
211 | struct fei_attr *attr = list_entry(v, struct fei_attr, list); | 211 | struct fei_attr *attr = list_entry(v, struct fei_attr, list); |
212 | 212 | ||
213 | seq_printf(m, "%pf\n", attr->kp.addr); | 213 | seq_printf(m, "%ps\n", attr->kp.addr); |
214 | return 0; | 214 | return 0; |
215 | } | 215 | } |
216 | 216 | ||
diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c index 516c00a5e867..c1eccd4f6520 100644 --- a/kernel/irq/debugfs.c +++ b/kernel/irq/debugfs.c | |||
@@ -152,7 +152,7 @@ static int irq_debug_show(struct seq_file *m, void *p) | |||
152 | 152 | ||
153 | raw_spin_lock_irq(&desc->lock); | 153 | raw_spin_lock_irq(&desc->lock); |
154 | data = irq_desc_get_irq_data(desc); | 154 | data = irq_desc_get_irq_data(desc); |
155 | seq_printf(m, "handler: %pf\n", desc->handle_irq); | 155 | seq_printf(m, "handler: %ps\n", desc->handle_irq); |
156 | seq_printf(m, "device: %s\n", desc->dev_name); | 156 | seq_printf(m, "device: %s\n", desc->dev_name); |
157 | seq_printf(m, "status: 0x%08x\n", desc->status_use_accessors); | 157 | seq_printf(m, "status: 0x%08x\n", desc->status_use_accessors); |
158 | irq_debug_show_bits(m, 0, desc->status_use_accessors, irqdesc_states, | 158 | irq_debug_show_bits(m, 0, desc->status_use_accessors, irqdesc_states, |
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index 6df5ddfdb0f8..a4ace611f47f 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -149,7 +149,7 @@ irqreturn_t __handle_irq_event_percpu(struct irq_desc *desc, unsigned int *flags | |||
149 | res = action->handler(irq, action->dev_id); | 149 | res = action->handler(irq, action->dev_id); |
150 | trace_irq_handler_exit(irq, action, res); | 150 | trace_irq_handler_exit(irq, action, res); |
151 | 151 | ||
152 | if (WARN_ONCE(!irqs_disabled(),"irq %u handler %pF enabled interrupts\n", | 152 | if (WARN_ONCE(!irqs_disabled(),"irq %u handler %pS enabled interrupts\n", |
153 | irq, action->handler)) | 153 | irq, action->handler)) |
154 | local_irq_disable(); | 154 | local_irq_disable(); |
155 | 155 | ||
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index 53a081392115..78f3ddeb7fe4 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -781,7 +781,7 @@ int __irq_set_trigger(struct irq_desc *desc, unsigned long flags) | |||
781 | ret = 0; | 781 | ret = 0; |
782 | break; | 782 | break; |
783 | default: | 783 | default: |
784 | pr_err("Setting trigger mode %lu for irq %u failed (%pF)\n", | 784 | pr_err("Setting trigger mode %lu for irq %u failed (%pS)\n", |
785 | flags, irq_desc_get_irq(desc), chip->irq_set_type); | 785 | flags, irq_desc_get_irq(desc), chip->irq_set_type); |
786 | } | 786 | } |
787 | if (unmask) | 787 | if (unmask) |
diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c index 6d2fa6914b30..2ed97a7c9b2a 100644 --- a/kernel/irq/spurious.c +++ b/kernel/irq/spurious.c | |||
@@ -212,9 +212,9 @@ static void __report_bad_irq(struct irq_desc *desc, irqreturn_t action_ret) | |||
212 | */ | 212 | */ |
213 | raw_spin_lock_irqsave(&desc->lock, flags); | 213 | raw_spin_lock_irqsave(&desc->lock, flags); |
214 | for_each_action_of_desc(desc, action) { | 214 | for_each_action_of_desc(desc, action) { |
215 | printk(KERN_ERR "[<%p>] %pf", action->handler, action->handler); | 215 | printk(KERN_ERR "[<%p>] %ps", action->handler, action->handler); |
216 | if (action->thread_fn) | 216 | if (action->thread_fn) |
217 | printk(KERN_CONT " threaded [<%p>] %pf", | 217 | printk(KERN_CONT " threaded [<%p>] %ps", |
218 | action->thread_fn, action->thread_fn); | 218 | action->thread_fn, action->thread_fn); |
219 | printk(KERN_CONT "\n"); | 219 | printk(KERN_CONT "\n"); |
220 | } | 220 | } |
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index ec77ec336f58..b4d88a594785 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c | |||
@@ -2392,7 +2392,7 @@ __call_rcu(struct rcu_head *head, rcu_callback_t func, int cpu, bool lazy) | |||
2392 | * Use rcu:rcu_callback trace event to find the previous | 2392 | * Use rcu:rcu_callback trace event to find the previous |
2393 | * time callback was passed to __call_rcu(). | 2393 | * time callback was passed to __call_rcu(). |
2394 | */ | 2394 | */ |
2395 | WARN_ONCE(1, "__call_rcu(): Double-freed CB %p->%pF()!!!\n", | 2395 | WARN_ONCE(1, "__call_rcu(): Double-freed CB %p->%pS()!!!\n", |
2396 | head, head->func); | 2396 | head, head->func); |
2397 | WRITE_ONCE(head->func, rcu_leak_callback); | 2397 | WRITE_ONCE(head->func, rcu_leak_callback); |
2398 | return; | 2398 | return; |
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 067cb83f37ea..7231fb5953fc 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
@@ -513,7 +513,7 @@ repeat: | |||
513 | } | 513 | } |
514 | preempt_count_dec(); | 514 | preempt_count_dec(); |
515 | WARN_ONCE(preempt_count(), | 515 | WARN_ONCE(preempt_count(), |
516 | "cpu_stop: %pf(%p) leaked preempt count\n", fn, arg); | 516 | "cpu_stop: %ps(%p) leaked preempt count\n", fn, arg); |
517 | goto repeat; | 517 | goto repeat; |
518 | } | 518 | } |
519 | } | 519 | } |
diff --git a/kernel/time/sched_clock.c b/kernel/time/sched_clock.c index 968e4b07918e..142b07619918 100644 --- a/kernel/time/sched_clock.c +++ b/kernel/time/sched_clock.c | |||
@@ -231,7 +231,7 @@ sched_clock_register(u64 (*read)(void), int bits, unsigned long rate) | |||
231 | if (irqtime > 0 || (irqtime == -1 && rate >= 1000000)) | 231 | if (irqtime > 0 || (irqtime == -1 && rate >= 1000000)) |
232 | enable_sched_clock_irqtime(); | 232 | enable_sched_clock_irqtime(); |
233 | 233 | ||
234 | pr_debug("Registered %pF as sched_clock source\n", read); | 234 | pr_debug("Registered %pS as sched_clock source\n", read); |
235 | } | 235 | } |
236 | 236 | ||
237 | void __init generic_sched_clock_init(void) | 237 | void __init generic_sched_clock_init(void) |
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index a9b1bbc2d88d..343c7ba33b1c 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c | |||
@@ -1325,7 +1325,7 @@ static void call_timer_fn(struct timer_list *timer, | |||
1325 | lock_map_release(&lockdep_map); | 1325 | lock_map_release(&lockdep_map); |
1326 | 1326 | ||
1327 | if (count != preempt_count()) { | 1327 | if (count != preempt_count()) { |
1328 | WARN_ONCE(1, "timer: %pF preempt leak: %08x -> %08x\n", | 1328 | WARN_ONCE(1, "timer: %pS preempt leak: %08x -> %08x\n", |
1329 | fn, count, preempt_count()); | 1329 | fn, count, preempt_count()); |
1330 | /* | 1330 | /* |
1331 | * Restore the preempt count. That gives us a decent | 1331 | * Restore the preempt count. That gives us a decent |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 56180c9286f5..faf7622246da 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -2271,7 +2271,7 @@ __acquires(&pool->lock) | |||
2271 | 2271 | ||
2272 | if (unlikely(in_atomic() || lockdep_depth(current) > 0)) { | 2272 | if (unlikely(in_atomic() || lockdep_depth(current) > 0)) { |
2273 | pr_err("BUG: workqueue leaked lock or atomic: %s/0x%08x/%d\n" | 2273 | pr_err("BUG: workqueue leaked lock or atomic: %s/0x%08x/%d\n" |
2274 | " last function: %pf\n", | 2274 | " last function: %ps\n", |
2275 | current->comm, preempt_count(), task_pid_nr(current), | 2275 | current->comm, preempt_count(), task_pid_nr(current), |
2276 | worker->current_func); | 2276 | worker->current_func); |
2277 | debug_show_held_locks(current); | 2277 | debug_show_held_locks(current); |
@@ -2590,11 +2590,11 @@ static void check_flush_dependency(struct workqueue_struct *target_wq, | |||
2590 | worker = current_wq_worker(); | 2590 | worker = current_wq_worker(); |
2591 | 2591 | ||
2592 | WARN_ONCE(current->flags & PF_MEMALLOC, | 2592 | WARN_ONCE(current->flags & PF_MEMALLOC, |
2593 | "workqueue: PF_MEMALLOC task %d(%s) is flushing !WQ_MEM_RECLAIM %s:%pf", | 2593 | "workqueue: PF_MEMALLOC task %d(%s) is flushing !WQ_MEM_RECLAIM %s:%ps", |
2594 | current->pid, current->comm, target_wq->name, target_func); | 2594 | current->pid, current->comm, target_wq->name, target_func); |
2595 | WARN_ONCE(worker && ((worker->current_pwq->wq->flags & | 2595 | WARN_ONCE(worker && ((worker->current_pwq->wq->flags & |
2596 | (WQ_MEM_RECLAIM | __WQ_LEGACY)) == WQ_MEM_RECLAIM), | 2596 | (WQ_MEM_RECLAIM | __WQ_LEGACY)) == WQ_MEM_RECLAIM), |
2597 | "workqueue: WQ_MEM_RECLAIM %s:%pf is flushing !WQ_MEM_RECLAIM %s:%pf", | 2597 | "workqueue: WQ_MEM_RECLAIM %s:%ps is flushing !WQ_MEM_RECLAIM %s:%ps", |
2598 | worker->current_pwq->wq->name, worker->current_func, | 2598 | worker->current_pwq->wq->name, worker->current_func, |
2599 | target_wq->name, target_func); | 2599 | target_wq->name, target_func); |
2600 | } | 2600 | } |
@@ -4581,7 +4581,7 @@ void print_worker_info(const char *log_lvl, struct task_struct *task) | |||
4581 | probe_kernel_read(desc, worker->desc, sizeof(desc) - 1); | 4581 | probe_kernel_read(desc, worker->desc, sizeof(desc) - 1); |
4582 | 4582 | ||
4583 | if (fn || name[0] || desc[0]) { | 4583 | if (fn || name[0] || desc[0]) { |
4584 | printk("%sWorkqueue: %s %pf", log_lvl, name, fn); | 4584 | printk("%sWorkqueue: %s %ps", log_lvl, name, fn); |
4585 | if (strcmp(name, desc)) | 4585 | if (strcmp(name, desc)) |
4586 | pr_cont(" (%s)", desc); | 4586 | pr_cont(" (%s)", desc); |
4587 | pr_cont("\n"); | 4587 | pr_cont("\n"); |
@@ -4606,7 +4606,7 @@ static void pr_cont_work(bool comma, struct work_struct *work) | |||
4606 | pr_cont("%s BAR(%d)", comma ? "," : "", | 4606 | pr_cont("%s BAR(%d)", comma ? "," : "", |
4607 | task_pid_nr(barr->task)); | 4607 | task_pid_nr(barr->task)); |
4608 | } else { | 4608 | } else { |
4609 | pr_cont("%s %pf", comma ? "," : "", work->func); | 4609 | pr_cont("%s %ps", comma ? "," : "", work->func); |
4610 | } | 4610 | } |
4611 | } | 4611 | } |
4612 | 4612 | ||
@@ -4638,7 +4638,7 @@ static void show_pwq(struct pool_workqueue *pwq) | |||
4638 | if (worker->current_pwq != pwq) | 4638 | if (worker->current_pwq != pwq) |
4639 | continue; | 4639 | continue; |
4640 | 4640 | ||
4641 | pr_cont("%s %d%s:%pf", comma ? "," : "", | 4641 | pr_cont("%s %d%s:%ps", comma ? "," : "", |
4642 | task_pid_nr(worker->task), | 4642 | task_pid_nr(worker->task), |
4643 | worker == pwq->wq->rescuer ? "(RESCUER)" : "", | 4643 | worker == pwq->wq->rescuer ? "(RESCUER)" : "", |
4644 | worker->current_func); | 4644 | worker->current_func); |
diff --git a/lib/error-inject.c b/lib/error-inject.c index c0d4600f4896..aa63751c916f 100644 --- a/lib/error-inject.c +++ b/lib/error-inject.c | |||
@@ -189,7 +189,7 @@ static int ei_seq_show(struct seq_file *m, void *v) | |||
189 | { | 189 | { |
190 | struct ei_entry *ent = list_entry(v, struct ei_entry, list); | 190 | struct ei_entry *ent = list_entry(v, struct ei_entry, list); |
191 | 191 | ||
192 | seq_printf(m, "%pf\t%s\n", (void *)ent->start_addr, | 192 | seq_printf(m, "%ps\t%s\n", (void *)ent->start_addr, |
193 | error_type_string(ent->etype)); | 193 | error_type_string(ent->etype)); |
194 | return 0; | 194 | return 0; |
195 | } | 195 | } |
diff --git a/lib/percpu-refcount.c b/lib/percpu-refcount.c index 9877682e49c7..da54318d3b55 100644 --- a/lib/percpu-refcount.c +++ b/lib/percpu-refcount.c | |||
@@ -151,7 +151,7 @@ static void percpu_ref_switch_to_atomic_rcu(struct rcu_head *rcu) | |||
151 | atomic_long_add((long)count - PERCPU_COUNT_BIAS, &ref->count); | 151 | atomic_long_add((long)count - PERCPU_COUNT_BIAS, &ref->count); |
152 | 152 | ||
153 | WARN_ONCE(atomic_long_read(&ref->count) <= 0, | 153 | WARN_ONCE(atomic_long_read(&ref->count) <= 0, |
154 | "percpu ref (%pf) <= 0 (%ld) after switching to atomic", | 154 | "percpu ref (%ps) <= 0 (%ld) after switching to atomic", |
155 | ref->release, atomic_long_read(&ref->count)); | 155 | ref->release, atomic_long_read(&ref->count)); |
156 | 156 | ||
157 | /* @ref is viewed as dead on all CPUs, send out switch confirmation */ | 157 | /* @ref is viewed as dead on all CPUs, send out switch confirmation */ |
@@ -333,7 +333,7 @@ void percpu_ref_kill_and_confirm(struct percpu_ref *ref, | |||
333 | spin_lock_irqsave(&percpu_ref_switch_lock, flags); | 333 | spin_lock_irqsave(&percpu_ref_switch_lock, flags); |
334 | 334 | ||
335 | WARN_ONCE(ref->percpu_count_ptr & __PERCPU_REF_DEAD, | 335 | WARN_ONCE(ref->percpu_count_ptr & __PERCPU_REF_DEAD, |
336 | "%s called more than once on %pf!", __func__, ref->release); | 336 | "%s called more than once on %ps!", __func__, ref->release); |
337 | 337 | ||
338 | ref->percpu_count_ptr |= __PERCPU_REF_DEAD; | 338 | ref->percpu_count_ptr |= __PERCPU_REF_DEAD; |
339 | __percpu_ref_switch_mode(ref, confirm_kill); | 339 | __percpu_ref_switch_mode(ref, confirm_kill); |
diff --git a/lib/test_printf.c b/lib/test_printf.c index f4fcc1c43739..93da0a5000ec 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c | |||
@@ -241,6 +241,7 @@ plain_format(void) | |||
241 | #define PTR ((void *)0x456789ab) | 241 | #define PTR ((void *)0x456789ab) |
242 | #define PTR_STR "456789ab" | 242 | #define PTR_STR "456789ab" |
243 | #define PTR_VAL_NO_CRNG "(ptrval)" | 243 | #define PTR_VAL_NO_CRNG "(ptrval)" |
244 | #define ZEROS "" | ||
244 | 245 | ||
245 | static int __init | 246 | static int __init |
246 | plain_format(void) | 247 | plain_format(void) |
@@ -270,7 +271,6 @@ plain_hash_to_buffer(const void *p, char *buf, size_t len) | |||
270 | return 0; | 271 | return 0; |
271 | } | 272 | } |
272 | 273 | ||
273 | |||
274 | static int __init | 274 | static int __init |
275 | plain_hash(void) | 275 | plain_hash(void) |
276 | { | 276 | { |
@@ -328,6 +328,24 @@ test_hashed(const char *fmt, const void *p) | |||
328 | } | 328 | } |
329 | 329 | ||
330 | static void __init | 330 | static void __init |
331 | null_pointer(void) | ||
332 | { | ||
333 | test_hashed("%p", NULL); | ||
334 | test(ZEROS "00000000", "%px", NULL); | ||
335 | test("(null)", "%pE", NULL); | ||
336 | } | ||
337 | |||
338 | #define PTR_INVALID ((void *)0x000000ab) | ||
339 | |||
340 | static void __init | ||
341 | invalid_pointer(void) | ||
342 | { | ||
343 | test_hashed("%p", PTR_INVALID); | ||
344 | test(ZEROS "000000ab", "%px", PTR_INVALID); | ||
345 | test("(efault)", "%pE", PTR_INVALID); | ||
346 | } | ||
347 | |||
348 | static void __init | ||
331 | symbol_ptr(void) | 349 | symbol_ptr(void) |
332 | { | 350 | { |
333 | } | 351 | } |
@@ -464,8 +482,7 @@ struct_rtc_time(void) | |||
464 | .tm_year = 118, | 482 | .tm_year = 118, |
465 | }; | 483 | }; |
466 | 484 | ||
467 | test_hashed("%pt", &tm); | 485 | test("(%ptR?)", "%pt", &tm); |
468 | |||
469 | test("2018-11-26T05:35:43", "%ptR", &tm); | 486 | test("2018-11-26T05:35:43", "%ptR", &tm); |
470 | test("0118-10-26T05:35:43", "%ptRr", &tm); | 487 | test("0118-10-26T05:35:43", "%ptRr", &tm); |
471 | test("05:35:43|2018-11-26", "%ptRt|%ptRd", &tm, &tm); | 488 | test("05:35:43|2018-11-26", "%ptRt|%ptRd", &tm, &tm); |
@@ -483,14 +500,14 @@ static void __init | |||
483 | large_bitmap(void) | 500 | large_bitmap(void) |
484 | { | 501 | { |
485 | const int nbits = 1 << 16; | 502 | const int nbits = 1 << 16; |
486 | unsigned long *bits = kcalloc(BITS_TO_LONGS(nbits), sizeof(long), GFP_KERNEL); | 503 | unsigned long *bits = bitmap_zalloc(nbits, GFP_KERNEL); |
487 | if (!bits) | 504 | if (!bits) |
488 | return; | 505 | return; |
489 | 506 | ||
490 | bitmap_set(bits, 1, 20); | 507 | bitmap_set(bits, 1, 20); |
491 | bitmap_set(bits, 60000, 15); | 508 | bitmap_set(bits, 60000, 15); |
492 | test("1-20,60000-60014", "%*pbl", nbits, bits); | 509 | test("1-20,60000-60014", "%*pbl", nbits, bits); |
493 | kfree(bits); | 510 | bitmap_free(bits); |
494 | } | 511 | } |
495 | 512 | ||
496 | static void __init | 513 | static void __init |
@@ -574,6 +591,8 @@ static void __init | |||
574 | test_pointer(void) | 591 | test_pointer(void) |
575 | { | 592 | { |
576 | plain(); | 593 | plain(); |
594 | null_pointer(); | ||
595 | invalid_pointer(); | ||
577 | symbol_ptr(); | 596 | symbol_ptr(); |
578 | kernel_ptr(); | 597 | kernel_ptr(); |
579 | struct_resource(); | 598 | struct_resource(); |
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 791b6fa36905..7b0a6140bfad 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c | |||
@@ -593,15 +593,13 @@ char *widen_string(char *buf, int n, char *end, struct printf_spec spec) | |||
593 | return buf; | 593 | return buf; |
594 | } | 594 | } |
595 | 595 | ||
596 | static noinline_for_stack | 596 | /* Handle string from a well known address. */ |
597 | char *string(char *buf, char *end, const char *s, struct printf_spec spec) | 597 | static char *string_nocheck(char *buf, char *end, const char *s, |
598 | struct printf_spec spec) | ||
598 | { | 599 | { |
599 | int len = 0; | 600 | int len = 0; |
600 | size_t lim = spec.precision; | 601 | size_t lim = spec.precision; |
601 | 602 | ||
602 | if ((unsigned long)s < PAGE_SIZE) | ||
603 | s = "(null)"; | ||
604 | |||
605 | while (lim--) { | 603 | while (lim--) { |
606 | char c = *s++; | 604 | char c = *s++; |
607 | if (!c) | 605 | if (!c) |
@@ -614,9 +612,67 @@ char *string(char *buf, char *end, const char *s, struct printf_spec spec) | |||
614 | return widen_string(buf, len, end, spec); | 612 | return widen_string(buf, len, end, spec); |
615 | } | 613 | } |
616 | 614 | ||
615 | /* Be careful: error messages must fit into the given buffer. */ | ||
616 | static char *error_string(char *buf, char *end, const char *s, | ||
617 | struct printf_spec spec) | ||
618 | { | ||
619 | /* | ||
620 | * Hard limit to avoid a completely insane messages. It actually | ||
621 | * works pretty well because most error messages are in | ||
622 | * the many pointer format modifiers. | ||
623 | */ | ||
624 | if (spec.precision == -1) | ||
625 | spec.precision = 2 * sizeof(void *); | ||
626 | |||
627 | return string_nocheck(buf, end, s, spec); | ||
628 | } | ||
629 | |||
630 | /* | ||
631 | * This is not a fool-proof test. 99% of the time that this will fault is | ||
632 | * due to a bad pointer, not one that crosses into bad memory. Just test | ||
633 | * the address to make sure it doesn't fault due to a poorly added printk | ||
634 | * during debugging. | ||
635 | */ | ||
636 | static const char *check_pointer_msg(const void *ptr) | ||
637 | { | ||
638 | char byte; | ||
639 | |||
640 | if (!ptr) | ||
641 | return "(null)"; | ||
642 | |||
643 | if (probe_kernel_address(ptr, byte)) | ||
644 | return "(efault)"; | ||
645 | |||
646 | return NULL; | ||
647 | } | ||
648 | |||
649 | static int check_pointer(char **buf, char *end, const void *ptr, | ||
650 | struct printf_spec spec) | ||
651 | { | ||
652 | const char *err_msg; | ||
653 | |||
654 | err_msg = check_pointer_msg(ptr); | ||
655 | if (err_msg) { | ||
656 | *buf = error_string(*buf, end, err_msg, spec); | ||
657 | return -EFAULT; | ||
658 | } | ||
659 | |||
660 | return 0; | ||
661 | } | ||
662 | |||
617 | static noinline_for_stack | 663 | static noinline_for_stack |
618 | char *pointer_string(char *buf, char *end, const void *ptr, | 664 | char *string(char *buf, char *end, const char *s, |
619 | struct printf_spec spec) | 665 | struct printf_spec spec) |
666 | { | ||
667 | if (check_pointer(&buf, end, s, spec)) | ||
668 | return buf; | ||
669 | |||
670 | return string_nocheck(buf, end, s, spec); | ||
671 | } | ||
672 | |||
673 | static char *pointer_string(char *buf, char *end, | ||
674 | const void *ptr, | ||
675 | struct printf_spec spec) | ||
620 | { | 676 | { |
621 | spec.base = 16; | 677 | spec.base = 16; |
622 | spec.flags |= SMALL; | 678 | spec.flags |= SMALL; |
@@ -701,7 +757,7 @@ static char *ptr_to_id(char *buf, char *end, const void *ptr, | |||
701 | if (static_branch_unlikely(¬_filled_random_ptr_key)) { | 757 | if (static_branch_unlikely(¬_filled_random_ptr_key)) { |
702 | spec.field_width = 2 * sizeof(ptr); | 758 | spec.field_width = 2 * sizeof(ptr); |
703 | /* string length must be less than default_width */ | 759 | /* string length must be less than default_width */ |
704 | return string(buf, end, str, spec); | 760 | return error_string(buf, end, str, spec); |
705 | } | 761 | } |
706 | 762 | ||
707 | #ifdef CONFIG_64BIT | 763 | #ifdef CONFIG_64BIT |
@@ -717,6 +773,55 @@ static char *ptr_to_id(char *buf, char *end, const void *ptr, | |||
717 | return pointer_string(buf, end, (const void *)hashval, spec); | 773 | return pointer_string(buf, end, (const void *)hashval, spec); |
718 | } | 774 | } |
719 | 775 | ||
776 | int kptr_restrict __read_mostly; | ||
777 | |||
778 | static noinline_for_stack | ||
779 | char *restricted_pointer(char *buf, char *end, const void *ptr, | ||
780 | struct printf_spec spec) | ||
781 | { | ||
782 | switch (kptr_restrict) { | ||
783 | case 0: | ||
784 | /* Handle as %p, hash and do _not_ leak addresses. */ | ||
785 | return ptr_to_id(buf, end, ptr, spec); | ||
786 | case 1: { | ||
787 | const struct cred *cred; | ||
788 | |||
789 | /* | ||
790 | * kptr_restrict==1 cannot be used in IRQ context | ||
791 | * because its test for CAP_SYSLOG would be meaningless. | ||
792 | */ | ||
793 | if (in_irq() || in_serving_softirq() || in_nmi()) { | ||
794 | if (spec.field_width == -1) | ||
795 | spec.field_width = 2 * sizeof(ptr); | ||
796 | return error_string(buf, end, "pK-error", spec); | ||
797 | } | ||
798 | |||
799 | /* | ||
800 | * Only print the real pointer value if the current | ||
801 | * process has CAP_SYSLOG and is running with the | ||
802 | * same credentials it started with. This is because | ||
803 | * access to files is checked at open() time, but %pK | ||
804 | * checks permission at read() time. We don't want to | ||
805 | * leak pointer values if a binary opens a file using | ||
806 | * %pK and then elevates privileges before reading it. | ||
807 | */ | ||
808 | cred = current_cred(); | ||
809 | if (!has_capability_noaudit(current, CAP_SYSLOG) || | ||
810 | !uid_eq(cred->euid, cred->uid) || | ||
811 | !gid_eq(cred->egid, cred->gid)) | ||
812 | ptr = NULL; | ||
813 | break; | ||
814 | } | ||
815 | case 2: | ||
816 | default: | ||
817 | /* Always print 0's for %pK */ | ||
818 | ptr = NULL; | ||
819 | break; | ||
820 | } | ||
821 | |||
822 | return pointer_string(buf, end, ptr, spec); | ||
823 | } | ||
824 | |||
720 | static noinline_for_stack | 825 | static noinline_for_stack |
721 | char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec, | 826 | char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec, |
722 | const char *fmt) | 827 | const char *fmt) |
@@ -736,6 +841,11 @@ char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_sp | |||
736 | 841 | ||
737 | rcu_read_lock(); | 842 | rcu_read_lock(); |
738 | for (i = 0; i < depth; i++, d = p) { | 843 | for (i = 0; i < depth; i++, d = p) { |
844 | if (check_pointer(&buf, end, d, spec)) { | ||
845 | rcu_read_unlock(); | ||
846 | return buf; | ||
847 | } | ||
848 | |||
739 | p = READ_ONCE(d->d_parent); | 849 | p = READ_ONCE(d->d_parent); |
740 | array[i] = READ_ONCE(d->d_name.name); | 850 | array[i] = READ_ONCE(d->d_name.name); |
741 | if (p == d) { | 851 | if (p == d) { |
@@ -766,8 +876,12 @@ static noinline_for_stack | |||
766 | char *bdev_name(char *buf, char *end, struct block_device *bdev, | 876 | char *bdev_name(char *buf, char *end, struct block_device *bdev, |
767 | struct printf_spec spec, const char *fmt) | 877 | struct printf_spec spec, const char *fmt) |
768 | { | 878 | { |
769 | struct gendisk *hd = bdev->bd_disk; | 879 | struct gendisk *hd; |
770 | 880 | ||
881 | if (check_pointer(&buf, end, bdev, spec)) | ||
882 | return buf; | ||
883 | |||
884 | hd = bdev->bd_disk; | ||
771 | buf = string(buf, end, hd->disk_name, spec); | 885 | buf = string(buf, end, hd->disk_name, spec); |
772 | if (bdev->bd_part->partno) { | 886 | if (bdev->bd_part->partno) { |
773 | if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) { | 887 | if (isdigit(hd->disk_name[strlen(hd->disk_name)-1])) { |
@@ -802,7 +916,7 @@ char *symbol_string(char *buf, char *end, void *ptr, | |||
802 | else | 916 | else |
803 | sprint_symbol_no_offset(sym, value); | 917 | sprint_symbol_no_offset(sym, value); |
804 | 918 | ||
805 | return string(buf, end, sym, spec); | 919 | return string_nocheck(buf, end, sym, spec); |
806 | #else | 920 | #else |
807 | return special_hex_number(buf, end, value, sizeof(void *)); | 921 | return special_hex_number(buf, end, value, sizeof(void *)); |
808 | #endif | 922 | #endif |
@@ -886,29 +1000,32 @@ char *resource_string(char *buf, char *end, struct resource *res, | |||
886 | int decode = (fmt[0] == 'R') ? 1 : 0; | 1000 | int decode = (fmt[0] == 'R') ? 1 : 0; |
887 | const struct printf_spec *specp; | 1001 | const struct printf_spec *specp; |
888 | 1002 | ||
1003 | if (check_pointer(&buf, end, res, spec)) | ||
1004 | return buf; | ||
1005 | |||
889 | *p++ = '['; | 1006 | *p++ = '['; |
890 | if (res->flags & IORESOURCE_IO) { | 1007 | if (res->flags & IORESOURCE_IO) { |
891 | p = string(p, pend, "io ", str_spec); | 1008 | p = string_nocheck(p, pend, "io ", str_spec); |
892 | specp = &io_spec; | 1009 | specp = &io_spec; |
893 | } else if (res->flags & IORESOURCE_MEM) { | 1010 | } else if (res->flags & IORESOURCE_MEM) { |
894 | p = string(p, pend, "mem ", str_spec); | 1011 | p = string_nocheck(p, pend, "mem ", str_spec); |
895 | specp = &mem_spec; | 1012 | specp = &mem_spec; |
896 | } else if (res->flags & IORESOURCE_IRQ) { | 1013 | } else if (res->flags & IORESOURCE_IRQ) { |
897 | p = string(p, pend, "irq ", str_spec); | 1014 | p = string_nocheck(p, pend, "irq ", str_spec); |
898 | specp = &default_dec_spec; | 1015 | specp = &default_dec_spec; |
899 | } else if (res->flags & IORESOURCE_DMA) { | 1016 | } else if (res->flags & IORESOURCE_DMA) { |
900 | p = string(p, pend, "dma ", str_spec); | 1017 | p = string_nocheck(p, pend, "dma ", str_spec); |
901 | specp = &default_dec_spec; | 1018 | specp = &default_dec_spec; |
902 | } else if (res->flags & IORESOURCE_BUS) { | 1019 | } else if (res->flags & IORESOURCE_BUS) { |
903 | p = string(p, pend, "bus ", str_spec); | 1020 | p = string_nocheck(p, pend, "bus ", str_spec); |
904 | specp = &bus_spec; | 1021 | specp = &bus_spec; |
905 | } else { | 1022 | } else { |
906 | p = string(p, pend, "??? ", str_spec); | 1023 | p = string_nocheck(p, pend, "??? ", str_spec); |
907 | specp = &mem_spec; | 1024 | specp = &mem_spec; |
908 | decode = 0; | 1025 | decode = 0; |
909 | } | 1026 | } |
910 | if (decode && res->flags & IORESOURCE_UNSET) { | 1027 | if (decode && res->flags & IORESOURCE_UNSET) { |
911 | p = string(p, pend, "size ", str_spec); | 1028 | p = string_nocheck(p, pend, "size ", str_spec); |
912 | p = number(p, pend, resource_size(res), *specp); | 1029 | p = number(p, pend, resource_size(res), *specp); |
913 | } else { | 1030 | } else { |
914 | p = number(p, pend, res->start, *specp); | 1031 | p = number(p, pend, res->start, *specp); |
@@ -919,21 +1036,21 @@ char *resource_string(char *buf, char *end, struct resource *res, | |||
919 | } | 1036 | } |
920 | if (decode) { | 1037 | if (decode) { |
921 | if (res->flags & IORESOURCE_MEM_64) | 1038 | if (res->flags & IORESOURCE_MEM_64) |
922 | p = string(p, pend, " 64bit", str_spec); | 1039 | p = string_nocheck(p, pend, " 64bit", str_spec); |
923 | if (res->flags & IORESOURCE_PREFETCH) | 1040 | if (res->flags & IORESOURCE_PREFETCH) |
924 | p = string(p, pend, " pref", str_spec); | 1041 | p = string_nocheck(p, pend, " pref", str_spec); |
925 | if (res->flags & IORESOURCE_WINDOW) | 1042 | if (res->flags & IORESOURCE_WINDOW) |
926 | p = string(p, pend, " window", str_spec); | 1043 | p = string_nocheck(p, pend, " window", str_spec); |
927 | if (res->flags & IORESOURCE_DISABLED) | 1044 | if (res->flags & IORESOURCE_DISABLED) |
928 | p = string(p, pend, " disabled", str_spec); | 1045 | p = string_nocheck(p, pend, " disabled", str_spec); |
929 | } else { | 1046 | } else { |
930 | p = string(p, pend, " flags ", str_spec); | 1047 | p = string_nocheck(p, pend, " flags ", str_spec); |
931 | p = number(p, pend, res->flags, default_flag_spec); | 1048 | p = number(p, pend, res->flags, default_flag_spec); |
932 | } | 1049 | } |
933 | *p++ = ']'; | 1050 | *p++ = ']'; |
934 | *p = '\0'; | 1051 | *p = '\0'; |
935 | 1052 | ||
936 | return string(buf, end, sym, spec); | 1053 | return string_nocheck(buf, end, sym, spec); |
937 | } | 1054 | } |
938 | 1055 | ||
939 | static noinline_for_stack | 1056 | static noinline_for_stack |
@@ -948,9 +1065,8 @@ char *hex_string(char *buf, char *end, u8 *addr, struct printf_spec spec, | |||
948 | /* nothing to print */ | 1065 | /* nothing to print */ |
949 | return buf; | 1066 | return buf; |
950 | 1067 | ||
951 | if (ZERO_OR_NULL_PTR(addr)) | 1068 | if (check_pointer(&buf, end, addr, spec)) |
952 | /* NULL pointer */ | 1069 | return buf; |
953 | return string(buf, end, NULL, spec); | ||
954 | 1070 | ||
955 | switch (fmt[1]) { | 1071 | switch (fmt[1]) { |
956 | case 'C': | 1072 | case 'C': |
@@ -997,6 +1113,9 @@ char *bitmap_string(char *buf, char *end, unsigned long *bitmap, | |||
997 | int i, chunksz; | 1113 | int i, chunksz; |
998 | bool first = true; | 1114 | bool first = true; |
999 | 1115 | ||
1116 | if (check_pointer(&buf, end, bitmap, spec)) | ||
1117 | return buf; | ||
1118 | |||
1000 | /* reused to print numbers */ | 1119 | /* reused to print numbers */ |
1001 | spec = (struct printf_spec){ .flags = SMALL | ZEROPAD, .base = 16 }; | 1120 | spec = (struct printf_spec){ .flags = SMALL | ZEROPAD, .base = 16 }; |
1002 | 1121 | ||
@@ -1038,6 +1157,9 @@ char *bitmap_list_string(char *buf, char *end, unsigned long *bitmap, | |||
1038 | int cur, rbot, rtop; | 1157 | int cur, rbot, rtop; |
1039 | bool first = true; | 1158 | bool first = true; |
1040 | 1159 | ||
1160 | if (check_pointer(&buf, end, bitmap, spec)) | ||
1161 | return buf; | ||
1162 | |||
1041 | rbot = cur = find_first_bit(bitmap, nr_bits); | 1163 | rbot = cur = find_first_bit(bitmap, nr_bits); |
1042 | while (cur < nr_bits) { | 1164 | while (cur < nr_bits) { |
1043 | rtop = cur; | 1165 | rtop = cur; |
@@ -1076,6 +1198,9 @@ char *mac_address_string(char *buf, char *end, u8 *addr, | |||
1076 | char separator; | 1198 | char separator; |
1077 | bool reversed = false; | 1199 | bool reversed = false; |
1078 | 1200 | ||
1201 | if (check_pointer(&buf, end, addr, spec)) | ||
1202 | return buf; | ||
1203 | |||
1079 | switch (fmt[1]) { | 1204 | switch (fmt[1]) { |
1080 | case 'F': | 1205 | case 'F': |
1081 | separator = '-'; | 1206 | separator = '-'; |
@@ -1101,7 +1226,7 @@ char *mac_address_string(char *buf, char *end, u8 *addr, | |||
1101 | } | 1226 | } |
1102 | *p = '\0'; | 1227 | *p = '\0'; |
1103 | 1228 | ||
1104 | return string(buf, end, mac_addr, spec); | 1229 | return string_nocheck(buf, end, mac_addr, spec); |
1105 | } | 1230 | } |
1106 | 1231 | ||
1107 | static noinline_for_stack | 1232 | static noinline_for_stack |
@@ -1264,7 +1389,7 @@ char *ip6_addr_string(char *buf, char *end, const u8 *addr, | |||
1264 | else | 1389 | else |
1265 | ip6_string(ip6_addr, addr, fmt); | 1390 | ip6_string(ip6_addr, addr, fmt); |
1266 | 1391 | ||
1267 | return string(buf, end, ip6_addr, spec); | 1392 | return string_nocheck(buf, end, ip6_addr, spec); |
1268 | } | 1393 | } |
1269 | 1394 | ||
1270 | static noinline_for_stack | 1395 | static noinline_for_stack |
@@ -1275,7 +1400,7 @@ char *ip4_addr_string(char *buf, char *end, const u8 *addr, | |||
1275 | 1400 | ||
1276 | ip4_string(ip4_addr, addr, fmt); | 1401 | ip4_string(ip4_addr, addr, fmt); |
1277 | 1402 | ||
1278 | return string(buf, end, ip4_addr, spec); | 1403 | return string_nocheck(buf, end, ip4_addr, spec); |
1279 | } | 1404 | } |
1280 | 1405 | ||
1281 | static noinline_for_stack | 1406 | static noinline_for_stack |
@@ -1337,7 +1462,7 @@ char *ip6_addr_string_sa(char *buf, char *end, const struct sockaddr_in6 *sa, | |||
1337 | } | 1462 | } |
1338 | *p = '\0'; | 1463 | *p = '\0'; |
1339 | 1464 | ||
1340 | return string(buf, end, ip6_addr, spec); | 1465 | return string_nocheck(buf, end, ip6_addr, spec); |
1341 | } | 1466 | } |
1342 | 1467 | ||
1343 | static noinline_for_stack | 1468 | static noinline_for_stack |
@@ -1372,7 +1497,42 @@ char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa, | |||
1372 | } | 1497 | } |
1373 | *p = '\0'; | 1498 | *p = '\0'; |
1374 | 1499 | ||
1375 | return string(buf, end, ip4_addr, spec); | 1500 | return string_nocheck(buf, end, ip4_addr, spec); |
1501 | } | ||
1502 | |||
1503 | static noinline_for_stack | ||
1504 | char *ip_addr_string(char *buf, char *end, const void *ptr, | ||
1505 | struct printf_spec spec, const char *fmt) | ||
1506 | { | ||
1507 | char *err_fmt_msg; | ||
1508 | |||
1509 | if (check_pointer(&buf, end, ptr, spec)) | ||
1510 | return buf; | ||
1511 | |||
1512 | switch (fmt[1]) { | ||
1513 | case '6': | ||
1514 | return ip6_addr_string(buf, end, ptr, spec, fmt); | ||
1515 | case '4': | ||
1516 | return ip4_addr_string(buf, end, ptr, spec, fmt); | ||
1517 | case 'S': { | ||
1518 | const union { | ||
1519 | struct sockaddr raw; | ||
1520 | struct sockaddr_in v4; | ||
1521 | struct sockaddr_in6 v6; | ||
1522 | } *sa = ptr; | ||
1523 | |||
1524 | switch (sa->raw.sa_family) { | ||
1525 | case AF_INET: | ||
1526 | return ip4_addr_string_sa(buf, end, &sa->v4, spec, fmt); | ||
1527 | case AF_INET6: | ||
1528 | return ip6_addr_string_sa(buf, end, &sa->v6, spec, fmt); | ||
1529 | default: | ||
1530 | return error_string(buf, end, "(einval)", spec); | ||
1531 | }} | ||
1532 | } | ||
1533 | |||
1534 | err_fmt_msg = fmt[0] == 'i' ? "(%pi?)" : "(%pI?)"; | ||
1535 | return error_string(buf, end, err_fmt_msg, spec); | ||
1376 | } | 1536 | } |
1377 | 1537 | ||
1378 | static noinline_for_stack | 1538 | static noinline_for_stack |
@@ -1387,9 +1547,8 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, | |||
1387 | if (spec.field_width == 0) | 1547 | if (spec.field_width == 0) |
1388 | return buf; /* nothing to print */ | 1548 | return buf; /* nothing to print */ |
1389 | 1549 | ||
1390 | if (ZERO_OR_NULL_PTR(addr)) | 1550 | if (check_pointer(&buf, end, addr, spec)) |
1391 | return string(buf, end, NULL, spec); /* NULL pointer */ | 1551 | return buf; |
1392 | |||
1393 | 1552 | ||
1394 | do { | 1553 | do { |
1395 | switch (fmt[count++]) { | 1554 | switch (fmt[count++]) { |
@@ -1435,6 +1594,21 @@ char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, | |||
1435 | return buf; | 1594 | return buf; |
1436 | } | 1595 | } |
1437 | 1596 | ||
1597 | static char *va_format(char *buf, char *end, struct va_format *va_fmt, | ||
1598 | struct printf_spec spec, const char *fmt) | ||
1599 | { | ||
1600 | va_list va; | ||
1601 | |||
1602 | if (check_pointer(&buf, end, va_fmt, spec)) | ||
1603 | return buf; | ||
1604 | |||
1605 | va_copy(va, *va_fmt->va); | ||
1606 | buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va); | ||
1607 | va_end(va); | ||
1608 | |||
1609 | return buf; | ||
1610 | } | ||
1611 | |||
1438 | static noinline_for_stack | 1612 | static noinline_for_stack |
1439 | char *uuid_string(char *buf, char *end, const u8 *addr, | 1613 | char *uuid_string(char *buf, char *end, const u8 *addr, |
1440 | struct printf_spec spec, const char *fmt) | 1614 | struct printf_spec spec, const char *fmt) |
@@ -1445,6 +1619,9 @@ char *uuid_string(char *buf, char *end, const u8 *addr, | |||
1445 | const u8 *index = uuid_index; | 1619 | const u8 *index = uuid_index; |
1446 | bool uc = false; | 1620 | bool uc = false; |
1447 | 1621 | ||
1622 | if (check_pointer(&buf, end, addr, spec)) | ||
1623 | return buf; | ||
1624 | |||
1448 | switch (*(++fmt)) { | 1625 | switch (*(++fmt)) { |
1449 | case 'L': | 1626 | case 'L': |
1450 | uc = true; /* fall-through */ | 1627 | uc = true; /* fall-through */ |
@@ -1473,56 +1650,7 @@ char *uuid_string(char *buf, char *end, const u8 *addr, | |||
1473 | 1650 | ||
1474 | *p = 0; | 1651 | *p = 0; |
1475 | 1652 | ||
1476 | return string(buf, end, uuid, spec); | 1653 | return string_nocheck(buf, end, uuid, spec); |
1477 | } | ||
1478 | |||
1479 | int kptr_restrict __read_mostly; | ||
1480 | |||
1481 | static noinline_for_stack | ||
1482 | char *restricted_pointer(char *buf, char *end, const void *ptr, | ||
1483 | struct printf_spec spec) | ||
1484 | { | ||
1485 | switch (kptr_restrict) { | ||
1486 | case 0: | ||
1487 | /* Always print %pK values */ | ||
1488 | break; | ||
1489 | case 1: { | ||
1490 | const struct cred *cred; | ||
1491 | |||
1492 | /* | ||
1493 | * kptr_restrict==1 cannot be used in IRQ context | ||
1494 | * because its test for CAP_SYSLOG would be meaningless. | ||
1495 | */ | ||
1496 | if (in_irq() || in_serving_softirq() || in_nmi()) { | ||
1497 | if (spec.field_width == -1) | ||
1498 | spec.field_width = 2 * sizeof(ptr); | ||
1499 | return string(buf, end, "pK-error", spec); | ||
1500 | } | ||
1501 | |||
1502 | /* | ||
1503 | * Only print the real pointer value if the current | ||
1504 | * process has CAP_SYSLOG and is running with the | ||
1505 | * same credentials it started with. This is because | ||
1506 | * access to files is checked at open() time, but %pK | ||
1507 | * checks permission at read() time. We don't want to | ||
1508 | * leak pointer values if a binary opens a file using | ||
1509 | * %pK and then elevates privileges before reading it. | ||
1510 | */ | ||
1511 | cred = current_cred(); | ||
1512 | if (!has_capability_noaudit(current, CAP_SYSLOG) || | ||
1513 | !uid_eq(cred->euid, cred->uid) || | ||
1514 | !gid_eq(cred->egid, cred->gid)) | ||
1515 | ptr = NULL; | ||
1516 | break; | ||
1517 | } | ||
1518 | case 2: | ||
1519 | default: | ||
1520 | /* Always print 0's for %pK */ | ||
1521 | ptr = NULL; | ||
1522 | break; | ||
1523 | } | ||
1524 | |||
1525 | return pointer_string(buf, end, ptr, spec); | ||
1526 | } | 1654 | } |
1527 | 1655 | ||
1528 | static noinline_for_stack | 1656 | static noinline_for_stack |
@@ -1532,24 +1660,31 @@ char *netdev_bits(char *buf, char *end, const void *addr, | |||
1532 | unsigned long long num; | 1660 | unsigned long long num; |
1533 | int size; | 1661 | int size; |
1534 | 1662 | ||
1663 | if (check_pointer(&buf, end, addr, spec)) | ||
1664 | return buf; | ||
1665 | |||
1535 | switch (fmt[1]) { | 1666 | switch (fmt[1]) { |
1536 | case 'F': | 1667 | case 'F': |
1537 | num = *(const netdev_features_t *)addr; | 1668 | num = *(const netdev_features_t *)addr; |
1538 | size = sizeof(netdev_features_t); | 1669 | size = sizeof(netdev_features_t); |
1539 | break; | 1670 | break; |
1540 | default: | 1671 | default: |
1541 | return ptr_to_id(buf, end, addr, spec); | 1672 | return error_string(buf, end, "(%pN?)", spec); |
1542 | } | 1673 | } |
1543 | 1674 | ||
1544 | return special_hex_number(buf, end, num, size); | 1675 | return special_hex_number(buf, end, num, size); |
1545 | } | 1676 | } |
1546 | 1677 | ||
1547 | static noinline_for_stack | 1678 | static noinline_for_stack |
1548 | char *address_val(char *buf, char *end, const void *addr, const char *fmt) | 1679 | char *address_val(char *buf, char *end, const void *addr, |
1680 | struct printf_spec spec, const char *fmt) | ||
1549 | { | 1681 | { |
1550 | unsigned long long num; | 1682 | unsigned long long num; |
1551 | int size; | 1683 | int size; |
1552 | 1684 | ||
1685 | if (check_pointer(&buf, end, addr, spec)) | ||
1686 | return buf; | ||
1687 | |||
1553 | switch (fmt[1]) { | 1688 | switch (fmt[1]) { |
1554 | case 'd': | 1689 | case 'd': |
1555 | num = *(const dma_addr_t *)addr; | 1690 | num = *(const dma_addr_t *)addr; |
@@ -1601,12 +1736,16 @@ char *time_str(char *buf, char *end, const struct rtc_time *tm, bool r) | |||
1601 | } | 1736 | } |
1602 | 1737 | ||
1603 | static noinline_for_stack | 1738 | static noinline_for_stack |
1604 | char *rtc_str(char *buf, char *end, const struct rtc_time *tm, const char *fmt) | 1739 | char *rtc_str(char *buf, char *end, const struct rtc_time *tm, |
1740 | struct printf_spec spec, const char *fmt) | ||
1605 | { | 1741 | { |
1606 | bool have_t = true, have_d = true; | 1742 | bool have_t = true, have_d = true; |
1607 | bool raw = false; | 1743 | bool raw = false; |
1608 | int count = 2; | 1744 | int count = 2; |
1609 | 1745 | ||
1746 | if (check_pointer(&buf, end, tm, spec)) | ||
1747 | return buf; | ||
1748 | |||
1610 | switch (fmt[count]) { | 1749 | switch (fmt[count]) { |
1611 | case 'd': | 1750 | case 'd': |
1612 | have_t = false; | 1751 | have_t = false; |
@@ -1640,9 +1779,9 @@ char *time_and_date(char *buf, char *end, void *ptr, struct printf_spec spec, | |||
1640 | { | 1779 | { |
1641 | switch (fmt[1]) { | 1780 | switch (fmt[1]) { |
1642 | case 'R': | 1781 | case 'R': |
1643 | return rtc_str(buf, end, (const struct rtc_time *)ptr, fmt); | 1782 | return rtc_str(buf, end, (const struct rtc_time *)ptr, spec, fmt); |
1644 | default: | 1783 | default: |
1645 | return ptr_to_id(buf, end, ptr, spec); | 1784 | return error_string(buf, end, "(%ptR?)", spec); |
1646 | } | 1785 | } |
1647 | } | 1786 | } |
1648 | 1787 | ||
@@ -1650,8 +1789,11 @@ static noinline_for_stack | |||
1650 | char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec, | 1789 | char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec, |
1651 | const char *fmt) | 1790 | const char *fmt) |
1652 | { | 1791 | { |
1653 | if (!IS_ENABLED(CONFIG_HAVE_CLK) || !clk) | 1792 | if (!IS_ENABLED(CONFIG_HAVE_CLK)) |
1654 | return string(buf, end, NULL, spec); | 1793 | return error_string(buf, end, "(%pC?)", spec); |
1794 | |||
1795 | if (check_pointer(&buf, end, clk, spec)) | ||
1796 | return buf; | ||
1655 | 1797 | ||
1656 | switch (fmt[1]) { | 1798 | switch (fmt[1]) { |
1657 | case 'n': | 1799 | case 'n': |
@@ -1659,7 +1801,7 @@ char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec, | |||
1659 | #ifdef CONFIG_COMMON_CLK | 1801 | #ifdef CONFIG_COMMON_CLK |
1660 | return string(buf, end, __clk_get_name(clk), spec); | 1802 | return string(buf, end, __clk_get_name(clk), spec); |
1661 | #else | 1803 | #else |
1662 | return ptr_to_id(buf, end, clk, spec); | 1804 | return error_string(buf, end, "(%pC?)", spec); |
1663 | #endif | 1805 | #endif |
1664 | } | 1806 | } |
1665 | } | 1807 | } |
@@ -1692,11 +1834,15 @@ char *format_flags(char *buf, char *end, unsigned long flags, | |||
1692 | } | 1834 | } |
1693 | 1835 | ||
1694 | static noinline_for_stack | 1836 | static noinline_for_stack |
1695 | char *flags_string(char *buf, char *end, void *flags_ptr, const char *fmt) | 1837 | char *flags_string(char *buf, char *end, void *flags_ptr, |
1838 | struct printf_spec spec, const char *fmt) | ||
1696 | { | 1839 | { |
1697 | unsigned long flags; | 1840 | unsigned long flags; |
1698 | const struct trace_print_flags *names; | 1841 | const struct trace_print_flags *names; |
1699 | 1842 | ||
1843 | if (check_pointer(&buf, end, flags_ptr, spec)) | ||
1844 | return buf; | ||
1845 | |||
1700 | switch (fmt[1]) { | 1846 | switch (fmt[1]) { |
1701 | case 'p': | 1847 | case 'p': |
1702 | flags = *(unsigned long *)flags_ptr; | 1848 | flags = *(unsigned long *)flags_ptr; |
@@ -1713,8 +1859,7 @@ char *flags_string(char *buf, char *end, void *flags_ptr, const char *fmt) | |||
1713 | names = gfpflag_names; | 1859 | names = gfpflag_names; |
1714 | break; | 1860 | break; |
1715 | default: | 1861 | default: |
1716 | WARN_ONCE(1, "Unsupported flags modifier: %c\n", fmt[1]); | 1862 | return error_string(buf, end, "(%pG?)", spec); |
1717 | return buf; | ||
1718 | } | 1863 | } |
1719 | 1864 | ||
1720 | return format_flags(buf, end, flags, names); | 1865 | return format_flags(buf, end, flags, names); |
@@ -1736,13 +1881,13 @@ char *device_node_gen_full_name(const struct device_node *np, char *buf, char *e | |||
1736 | 1881 | ||
1737 | /* special case for root node */ | 1882 | /* special case for root node */ |
1738 | if (!parent) | 1883 | if (!parent) |
1739 | return string(buf, end, "/", default_str_spec); | 1884 | return string_nocheck(buf, end, "/", default_str_spec); |
1740 | 1885 | ||
1741 | for (depth = 0; parent->parent; depth++) | 1886 | for (depth = 0; parent->parent; depth++) |
1742 | parent = parent->parent; | 1887 | parent = parent->parent; |
1743 | 1888 | ||
1744 | for ( ; depth >= 0; depth--) { | 1889 | for ( ; depth >= 0; depth--) { |
1745 | buf = string(buf, end, "/", default_str_spec); | 1890 | buf = string_nocheck(buf, end, "/", default_str_spec); |
1746 | buf = string(buf, end, device_node_name_for_depth(np, depth), | 1891 | buf = string(buf, end, device_node_name_for_depth(np, depth), |
1747 | default_str_spec); | 1892 | default_str_spec); |
1748 | } | 1893 | } |
@@ -1770,10 +1915,10 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, | |||
1770 | str_spec.field_width = -1; | 1915 | str_spec.field_width = -1; |
1771 | 1916 | ||
1772 | if (!IS_ENABLED(CONFIG_OF)) | 1917 | if (!IS_ENABLED(CONFIG_OF)) |
1773 | return string(buf, end, "(!OF)", spec); | 1918 | return error_string(buf, end, "(%pOF?)", spec); |
1774 | 1919 | ||
1775 | if ((unsigned long)dn < PAGE_SIZE) | 1920 | if (check_pointer(&buf, end, dn, spec)) |
1776 | return string(buf, end, "(null)", spec); | 1921 | return buf; |
1777 | 1922 | ||
1778 | /* simple case without anything any more format specifiers */ | 1923 | /* simple case without anything any more format specifiers */ |
1779 | fmt++; | 1924 | fmt++; |
@@ -1814,7 +1959,7 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, | |||
1814 | tbuf[2] = of_node_check_flag(dn, OF_POPULATED) ? 'P' : '-'; | 1959 | tbuf[2] = of_node_check_flag(dn, OF_POPULATED) ? 'P' : '-'; |
1815 | tbuf[3] = of_node_check_flag(dn, OF_POPULATED_BUS) ? 'B' : '-'; | 1960 | tbuf[3] = of_node_check_flag(dn, OF_POPULATED_BUS) ? 'B' : '-'; |
1816 | tbuf[4] = 0; | 1961 | tbuf[4] = 0; |
1817 | buf = string(buf, end, tbuf, str_spec); | 1962 | buf = string_nocheck(buf, end, tbuf, str_spec); |
1818 | break; | 1963 | break; |
1819 | case 'c': /* major compatible string */ | 1964 | case 'c': /* major compatible string */ |
1820 | ret = of_property_read_string(dn, "compatible", &p); | 1965 | ret = of_property_read_string(dn, "compatible", &p); |
@@ -1825,10 +1970,10 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, | |||
1825 | has_mult = false; | 1970 | has_mult = false; |
1826 | of_property_for_each_string(dn, "compatible", prop, p) { | 1971 | of_property_for_each_string(dn, "compatible", prop, p) { |
1827 | if (has_mult) | 1972 | if (has_mult) |
1828 | buf = string(buf, end, ",", str_spec); | 1973 | buf = string_nocheck(buf, end, ",", str_spec); |
1829 | buf = string(buf, end, "\"", str_spec); | 1974 | buf = string_nocheck(buf, end, "\"", str_spec); |
1830 | buf = string(buf, end, p, str_spec); | 1975 | buf = string(buf, end, p, str_spec); |
1831 | buf = string(buf, end, "\"", str_spec); | 1976 | buf = string_nocheck(buf, end, "\"", str_spec); |
1832 | 1977 | ||
1833 | has_mult = true; | 1978 | has_mult = true; |
1834 | } | 1979 | } |
@@ -1841,6 +1986,17 @@ char *device_node_string(char *buf, char *end, struct device_node *dn, | |||
1841 | return widen_string(buf, buf - buf_start, end, spec); | 1986 | return widen_string(buf, buf - buf_start, end, spec); |
1842 | } | 1987 | } |
1843 | 1988 | ||
1989 | static char *kobject_string(char *buf, char *end, void *ptr, | ||
1990 | struct printf_spec spec, const char *fmt) | ||
1991 | { | ||
1992 | switch (fmt[1]) { | ||
1993 | case 'F': | ||
1994 | return device_node_string(buf, end, ptr, spec, fmt + 1); | ||
1995 | } | ||
1996 | |||
1997 | return error_string(buf, end, "(%pO?)", spec); | ||
1998 | } | ||
1999 | |||
1844 | /* | 2000 | /* |
1845 | * Show a '%p' thing. A kernel extension is that the '%p' is followed | 2001 | * Show a '%p' thing. A kernel extension is that the '%p' is followed |
1846 | * by an extra set of alphanumeric characters that are extended format | 2002 | * by an extra set of alphanumeric characters that are extended format |
@@ -1957,18 +2113,6 @@ static noinline_for_stack | |||
1957 | char *pointer(const char *fmt, char *buf, char *end, void *ptr, | 2113 | char *pointer(const char *fmt, char *buf, char *end, void *ptr, |
1958 | struct printf_spec spec) | 2114 | struct printf_spec spec) |
1959 | { | 2115 | { |
1960 | const int default_width = 2 * sizeof(void *); | ||
1961 | |||
1962 | if (!ptr && *fmt != 'K' && *fmt != 'x') { | ||
1963 | /* | ||
1964 | * Print (null) with the same width as a pointer so it makes | ||
1965 | * tabular output look nice. | ||
1966 | */ | ||
1967 | if (spec.field_width == -1) | ||
1968 | spec.field_width = default_width; | ||
1969 | return string(buf, end, "(null)", spec); | ||
1970 | } | ||
1971 | |||
1972 | switch (*fmt) { | 2116 | switch (*fmt) { |
1973 | case 'F': | 2117 | case 'F': |
1974 | case 'f': | 2118 | case 'f': |
@@ -2004,50 +2148,19 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, | |||
2004 | * 4: 001.002.003.004 | 2148 | * 4: 001.002.003.004 |
2005 | * 6: 000102...0f | 2149 | * 6: 000102...0f |
2006 | */ | 2150 | */ |
2007 | switch (fmt[1]) { | 2151 | return ip_addr_string(buf, end, ptr, spec, fmt); |
2008 | case '6': | ||
2009 | return ip6_addr_string(buf, end, ptr, spec, fmt); | ||
2010 | case '4': | ||
2011 | return ip4_addr_string(buf, end, ptr, spec, fmt); | ||
2012 | case 'S': { | ||
2013 | const union { | ||
2014 | struct sockaddr raw; | ||
2015 | struct sockaddr_in v4; | ||
2016 | struct sockaddr_in6 v6; | ||
2017 | } *sa = ptr; | ||
2018 | |||
2019 | switch (sa->raw.sa_family) { | ||
2020 | case AF_INET: | ||
2021 | return ip4_addr_string_sa(buf, end, &sa->v4, spec, fmt); | ||
2022 | case AF_INET6: | ||
2023 | return ip6_addr_string_sa(buf, end, &sa->v6, spec, fmt); | ||
2024 | default: | ||
2025 | return string(buf, end, "(invalid address)", spec); | ||
2026 | }} | ||
2027 | } | ||
2028 | break; | ||
2029 | case 'E': | 2152 | case 'E': |
2030 | return escaped_string(buf, end, ptr, spec, fmt); | 2153 | return escaped_string(buf, end, ptr, spec, fmt); |
2031 | case 'U': | 2154 | case 'U': |
2032 | return uuid_string(buf, end, ptr, spec, fmt); | 2155 | return uuid_string(buf, end, ptr, spec, fmt); |
2033 | case 'V': | 2156 | case 'V': |
2034 | { | 2157 | return va_format(buf, end, ptr, spec, fmt); |
2035 | va_list va; | ||
2036 | |||
2037 | va_copy(va, *((struct va_format *)ptr)->va); | ||
2038 | buf += vsnprintf(buf, end > buf ? end - buf : 0, | ||
2039 | ((struct va_format *)ptr)->fmt, va); | ||
2040 | va_end(va); | ||
2041 | return buf; | ||
2042 | } | ||
2043 | case 'K': | 2158 | case 'K': |
2044 | if (!kptr_restrict) | ||
2045 | break; | ||
2046 | return restricted_pointer(buf, end, ptr, spec); | 2159 | return restricted_pointer(buf, end, ptr, spec); |
2047 | case 'N': | 2160 | case 'N': |
2048 | return netdev_bits(buf, end, ptr, spec, fmt); | 2161 | return netdev_bits(buf, end, ptr, spec, fmt); |
2049 | case 'a': | 2162 | case 'a': |
2050 | return address_val(buf, end, ptr, fmt); | 2163 | return address_val(buf, end, ptr, spec, fmt); |
2051 | case 'd': | 2164 | case 'd': |
2052 | return dentry_name(buf, end, ptr, spec, fmt); | 2165 | return dentry_name(buf, end, ptr, spec, fmt); |
2053 | case 't': | 2166 | case 't': |
@@ -2064,13 +2177,9 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, | |||
2064 | #endif | 2177 | #endif |
2065 | 2178 | ||
2066 | case 'G': | 2179 | case 'G': |
2067 | return flags_string(buf, end, ptr, fmt); | 2180 | return flags_string(buf, end, ptr, spec, fmt); |
2068 | case 'O': | 2181 | case 'O': |
2069 | switch (fmt[1]) { | 2182 | return kobject_string(buf, end, ptr, spec, fmt); |
2070 | case 'F': | ||
2071 | return device_node_string(buf, end, ptr, spec, fmt + 1); | ||
2072 | } | ||
2073 | break; | ||
2074 | case 'x': | 2183 | case 'x': |
2075 | return pointer_string(buf, end, ptr, spec); | 2184 | return pointer_string(buf, end, ptr, spec); |
2076 | } | 2185 | } |
@@ -2685,11 +2794,13 @@ int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args) | |||
2685 | 2794 | ||
2686 | case FORMAT_TYPE_STR: { | 2795 | case FORMAT_TYPE_STR: { |
2687 | const char *save_str = va_arg(args, char *); | 2796 | const char *save_str = va_arg(args, char *); |
2797 | const char *err_msg; | ||
2688 | size_t len; | 2798 | size_t len; |
2689 | 2799 | ||
2690 | if ((unsigned long)save_str > (unsigned long)-PAGE_SIZE | 2800 | err_msg = check_pointer_msg(save_str); |
2691 | || (unsigned long)save_str < PAGE_SIZE) | 2801 | if (err_msg) |
2692 | save_str = "(null)"; | 2802 | save_str = err_msg; |
2803 | |||
2693 | len = strlen(save_str) + 1; | 2804 | len = strlen(save_str) + 1; |
2694 | if (str + len < end) | 2805 | if (str + len < end) |
2695 | memcpy(str, save_str, len); | 2806 | memcpy(str, save_str, len); |
diff --git a/mm/memblock.c b/mm/memblock.c index e7665cf914b1..a48f520c2d01 100644 --- a/mm/memblock.c +++ b/mm/memblock.c | |||
@@ -702,7 +702,7 @@ int __init_memblock memblock_add(phys_addr_t base, phys_addr_t size) | |||
702 | { | 702 | { |
703 | phys_addr_t end = base + size - 1; | 703 | phys_addr_t end = base + size - 1; |
704 | 704 | ||
705 | memblock_dbg("memblock_add: [%pa-%pa] %pF\n", | 705 | memblock_dbg("memblock_add: [%pa-%pa] %pS\n", |
706 | &base, &end, (void *)_RET_IP_); | 706 | &base, &end, (void *)_RET_IP_); |
707 | 707 | ||
708 | return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0); | 708 | return memblock_add_range(&memblock.memory, base, size, MAX_NUMNODES, 0); |
@@ -821,7 +821,7 @@ int __init_memblock memblock_free(phys_addr_t base, phys_addr_t size) | |||
821 | { | 821 | { |
822 | phys_addr_t end = base + size - 1; | 822 | phys_addr_t end = base + size - 1; |
823 | 823 | ||
824 | memblock_dbg(" memblock_free: [%pa-%pa] %pF\n", | 824 | memblock_dbg(" memblock_free: [%pa-%pa] %pS\n", |
825 | &base, &end, (void *)_RET_IP_); | 825 | &base, &end, (void *)_RET_IP_); |
826 | 826 | ||
827 | kmemleak_free_part_phys(base, size); | 827 | kmemleak_free_part_phys(base, size); |
@@ -832,7 +832,7 @@ int __init_memblock memblock_reserve(phys_addr_t base, phys_addr_t size) | |||
832 | { | 832 | { |
833 | phys_addr_t end = base + size - 1; | 833 | phys_addr_t end = base + size - 1; |
834 | 834 | ||
835 | memblock_dbg("memblock_reserve: [%pa-%pa] %pF\n", | 835 | memblock_dbg("memblock_reserve: [%pa-%pa] %pS\n", |
836 | &base, &end, (void *)_RET_IP_); | 836 | &base, &end, (void *)_RET_IP_); |
837 | 837 | ||
838 | return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0); | 838 | return memblock_add_range(&memblock.reserved, base, size, MAX_NUMNODES, 0); |
@@ -1447,7 +1447,7 @@ void * __init memblock_alloc_try_nid_raw( | |||
1447 | { | 1447 | { |
1448 | void *ptr; | 1448 | void *ptr; |
1449 | 1449 | ||
1450 | memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pF\n", | 1450 | memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pS\n", |
1451 | __func__, (u64)size, (u64)align, nid, &min_addr, | 1451 | __func__, (u64)size, (u64)align, nid, &min_addr, |
1452 | &max_addr, (void *)_RET_IP_); | 1452 | &max_addr, (void *)_RET_IP_); |
1453 | 1453 | ||
@@ -1483,7 +1483,7 @@ void * __init memblock_alloc_try_nid( | |||
1483 | { | 1483 | { |
1484 | void *ptr; | 1484 | void *ptr; |
1485 | 1485 | ||
1486 | memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pF\n", | 1486 | memblock_dbg("%s: %llu bytes align=0x%llx nid=%d from=%pa max_addr=%pa %pS\n", |
1487 | __func__, (u64)size, (u64)align, nid, &min_addr, | 1487 | __func__, (u64)size, (u64)align, nid, &min_addr, |
1488 | &max_addr, (void *)_RET_IP_); | 1488 | &max_addr, (void *)_RET_IP_); |
1489 | ptr = memblock_alloc_internal(size, align, | 1489 | ptr = memblock_alloc_internal(size, align, |
@@ -1508,7 +1508,7 @@ void __init __memblock_free_late(phys_addr_t base, phys_addr_t size) | |||
1508 | phys_addr_t cursor, end; | 1508 | phys_addr_t cursor, end; |
1509 | 1509 | ||
1510 | end = base + size - 1; | 1510 | end = base + size - 1; |
1511 | memblock_dbg("%s: [%pa-%pa] %pF\n", | 1511 | memblock_dbg("%s: [%pa-%pa] %pS\n", |
1512 | __func__, &base, &end, (void *)_RET_IP_); | 1512 | __func__, &base, &end, (void *)_RET_IP_); |
1513 | kmemleak_free_part_phys(base, size); | 1513 | kmemleak_free_part_phys(base, size); |
1514 | cursor = PFN_UP(base); | 1514 | cursor = PFN_UP(base); |
diff --git a/mm/memory.c b/mm/memory.c index 36aac6844662..f7d962d7de19 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -519,7 +519,7 @@ static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr, | |||
519 | dump_page(page, "bad pte"); | 519 | dump_page(page, "bad pte"); |
520 | pr_alert("addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n", | 520 | pr_alert("addr:%p vm_flags:%08lx anon_vma:%p mapping:%p index:%lx\n", |
521 | (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index); | 521 | (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index); |
522 | pr_alert("file:%pD fault:%pf mmap:%pf readpage:%pf\n", | 522 | pr_alert("file:%pD fault:%ps mmap:%ps readpage:%ps\n", |
523 | vma->vm_file, | 523 | vma->vm_file, |
524 | vma->vm_ops ? vma->vm_ops->fault : NULL, | 524 | vma->vm_ops ? vma->vm_ops->fault : NULL, |
525 | vma->vm_file ? vma->vm_file->f_op->mmap : NULL, | 525 | vma->vm_file ? vma->vm_file->f_op->mmap : NULL, |
diff --git a/mm/vmscan.c b/mm/vmscan.c index a815f73ee4d5..fd9de504e516 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -493,7 +493,7 @@ static unsigned long do_shrink_slab(struct shrink_control *shrinkctl, | |||
493 | 493 | ||
494 | total_scan += delta; | 494 | total_scan += delta; |
495 | if (total_scan < 0) { | 495 | if (total_scan < 0) { |
496 | pr_err("shrink_slab: %pF negative objects to delete nr=%ld\n", | 496 | pr_err("shrink_slab: %pS negative objects to delete nr=%ld\n", |
497 | shrinker->scan_objects, total_scan); | 497 | shrinker->scan_objects, total_scan); |
498 | total_scan = freeable; | 498 | total_scan = freeable; |
499 | next_deferred = nr; | 499 | next_deferred = nr; |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index fa9530dd876e..6f739de28918 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -2398,7 +2398,7 @@ static void finish_request(struct ceph_osd_request *req) | |||
2398 | 2398 | ||
2399 | static void __complete_request(struct ceph_osd_request *req) | 2399 | static void __complete_request(struct ceph_osd_request *req) |
2400 | { | 2400 | { |
2401 | dout("%s req %p tid %llu cb %pf result %d\n", __func__, req, | 2401 | dout("%s req %p tid %llu cb %ps result %d\n", __func__, req, |
2402 | req->r_tid, req->r_callback, req->r_result); | 2402 | req->r_tid, req->r_callback, req->r_result); |
2403 | 2403 | ||
2404 | if (req->r_callback) | 2404 | if (req->r_callback) |
diff --git a/net/core/net-procfs.c b/net/core/net-procfs.c index 63881f72ef71..36347933ec3a 100644 --- a/net/core/net-procfs.c +++ b/net/core/net-procfs.c | |||
@@ -258,7 +258,7 @@ static int ptype_seq_show(struct seq_file *seq, void *v) | |||
258 | else | 258 | else |
259 | seq_printf(seq, "%04x", ntohs(pt->type)); | 259 | seq_printf(seq, "%04x", ntohs(pt->type)); |
260 | 260 | ||
261 | seq_printf(seq, " %-8s %pf\n", | 261 | seq_printf(seq, " %-8s %ps\n", |
262 | pt->dev ? pt->dev->name : "", pt->func); | 262 | pt->dev ? pt->dev->name : "", pt->func); |
263 | } | 263 | } |
264 | 264 | ||
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 361aabffb8c0..bf5446192d6a 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c | |||
@@ -149,7 +149,7 @@ static void poll_one_napi(struct napi_struct *napi) | |||
149 | * indicate that we are clearing the Tx path only. | 149 | * indicate that we are clearing the Tx path only. |
150 | */ | 150 | */ |
151 | work = napi->poll(napi, 0); | 151 | work = napi->poll(napi, 0); |
152 | WARN_ONCE(work, "%pF exceeded budget in poll\n", napi->poll); | 152 | WARN_ONCE(work, "%pS exceeded budget in poll\n", napi->poll); |
153 | trace_napi_poll(napi, work, 0); | 153 | trace_napi_poll(napi, work, 0); |
154 | 154 | ||
155 | clear_bit(NAPI_STATE_NPSVC, &napi->state); | 155 | clear_bit(NAPI_STATE_NPSVC, &napi->state); |
@@ -346,7 +346,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, | |||
346 | } | 346 | } |
347 | 347 | ||
348 | WARN_ONCE(!irqs_disabled(), | 348 | WARN_ONCE(!irqs_disabled(), |
349 | "netpoll_send_skb_on_dev(): %s enabled interrupts in poll (%pF)\n", | 349 | "netpoll_send_skb_on_dev(): %s enabled interrupts in poll (%pS)\n", |
350 | dev->name, dev->netdev_ops->ndo_start_xmit); | 350 | dev->name, dev->netdev_ops->ndo_start_xmit); |
351 | 351 | ||
352 | } | 352 | } |