aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-13 02:30:07 -0500
committerIngo Molnar <mingo@kernel.org>2016-02-13 02:30:07 -0500
commite2d6f8a5f596b1f09839990b11a3c2e0c9f0dbc2 (patch)
tree7ccf35788cbb9def996204399f079366da251361 /lib
parentfed0764fafd8e2e629a033c0f7df4106b0dcb7f0 (diff)
parent0cbb0b92689a1c4e0ac55f6188be563a813ac808 (diff)
Merge branch 'linus' into locking/core, to resolve conflicts
Conflicts: kernel/locking/lockdep.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug15
-rw-r--r--lib/Kconfig.ubsan4
-rw-r--r--lib/vsprintf.c26
3 files changed, 31 insertions, 14 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index ecb9e75614bf..8bfd1aca7a3d 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1400,6 +1400,21 @@ config RCU_EQS_DEBUG
1400 1400
1401endmenu # "RCU Debugging" 1401endmenu # "RCU Debugging"
1402 1402
1403config DEBUG_WQ_FORCE_RR_CPU
1404 bool "Force round-robin CPU selection for unbound work items"
1405 depends on DEBUG_KERNEL
1406 default n
1407 help
1408 Workqueue used to implicitly guarantee that work items queued
1409 without explicit CPU specified are put on the local CPU. This
1410 guarantee is no longer true and while local CPU is still
1411 preferred work items may be put on foreign CPUs. Kernel
1412 parameter "workqueue.debug_force_rr_cpu" is added to force
1413 round-robin CPU selection to flush out usages which depend on the
1414 now broken guarantee. This config option enables the debug
1415 feature by default. When enabled, memory and cache locality will
1416 be impacted.
1417
1403config DEBUG_BLOCK_EXT_DEVT 1418config DEBUG_BLOCK_EXT_DEVT
1404 bool "Force extended block device numbers and spread them" 1419 bool "Force extended block device numbers and spread them"
1405 depends on DEBUG_KERNEL 1420 depends on DEBUG_KERNEL
diff --git a/lib/Kconfig.ubsan b/lib/Kconfig.ubsan
index 49518fb48cab..e07c1ba9ba13 100644
--- a/lib/Kconfig.ubsan
+++ b/lib/Kconfig.ubsan
@@ -18,6 +18,8 @@ config UBSAN_SANITIZE_ALL
18 This option activates instrumentation for the entire kernel. 18 This option activates instrumentation for the entire kernel.
19 If you don't enable this option, you have to explicitly specify 19 If you don't enable this option, you have to explicitly specify
20 UBSAN_SANITIZE := y for the files/directories you want to check for UB. 20 UBSAN_SANITIZE := y for the files/directories you want to check for UB.
21 Enabling this option will get kernel image size increased
22 significantly.
21 23
22config UBSAN_ALIGNMENT 24config UBSAN_ALIGNMENT
23 bool "Enable checking of pointers alignment" 25 bool "Enable checking of pointers alignment"
@@ -25,5 +27,5 @@ config UBSAN_ALIGNMENT
25 default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS 27 default y if !HAVE_EFFICIENT_UNALIGNED_ACCESS
26 help 28 help
27 This option enables detection of unaligned memory accesses. 29 This option enables detection of unaligned memory accesses.
28 Enabling this option on architectures that support unalligned 30 Enabling this option on architectures that support unaligned
29 accesses may produce a lot of false positives. 31 accesses may produce a lot of false positives.
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 48ff9c36644d..f44e178e6ede 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1590,22 +1590,23 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
1590 return buf; 1590 return buf;
1591 } 1591 }
1592 case 'K': 1592 case 'K':
1593 /*
1594 * %pK cannot be used in IRQ context because its test
1595 * for CAP_SYSLOG would be meaningless.
1596 */
1597 if (kptr_restrict && (in_irq() || in_serving_softirq() ||
1598 in_nmi())) {
1599 if (spec.field_width == -1)
1600 spec.field_width = default_width;
1601 return string(buf, end, "pK-error", spec);
1602 }
1603
1604 switch (kptr_restrict) { 1593 switch (kptr_restrict) {
1605 case 0: 1594 case 0:
1606 /* Always print %pK values */ 1595 /* Always print %pK values */
1607 break; 1596 break;
1608 case 1: { 1597 case 1: {
1598 const struct cred *cred;
1599
1600 /*
1601 * kptr_restrict==1 cannot be used in IRQ context
1602 * because its test for CAP_SYSLOG would be meaningless.
1603 */
1604 if (in_irq() || in_serving_softirq() || in_nmi()) {
1605 if (spec.field_width == -1)
1606 spec.field_width = default_width;
1607 return string(buf, end, "pK-error", spec);
1608 }
1609
1609 /* 1610 /*
1610 * Only print the real pointer value if the current 1611 * Only print the real pointer value if the current
1611 * process has CAP_SYSLOG and is running with the 1612 * process has CAP_SYSLOG and is running with the
@@ -1615,8 +1616,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
1615 * leak pointer values if a binary opens a file using 1616 * leak pointer values if a binary opens a file using
1616 * %pK and then elevates privileges before reading it. 1617 * %pK and then elevates privileges before reading it.
1617 */ 1618 */
1618 const struct cred *cred = current_cred(); 1619 cred = current_cred();
1619
1620 if (!has_capability_noaudit(current, CAP_SYSLOG) || 1620 if (!has_capability_noaudit(current, CAP_SYSLOG) ||
1621 !uid_eq(cred->euid, cred->uid) || 1621 !uid_eq(cred->euid, cred->uid) ||
1622 !gid_eq(cred->egid, cred->gid)) 1622 !gid_eq(cred->egid, cred->gid))