diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.kasan | 4 | ||||
| -rw-r--r-- | lib/decompress.c | 5 | ||||
| -rw-r--r-- | lib/dma-debug.c | 3 | ||||
| -rw-r--r-- | lib/hexdump.c | 7 | ||||
| -rw-r--r-- | lib/kobject.c | 5 | ||||
| -rw-r--r-- | lib/rhashtable.c | 4 |
6 files changed, 16 insertions, 12 deletions
diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 777eda7d1ab4..39f24d6721e5 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan | |||
| @@ -18,10 +18,6 @@ config KASAN | |||
| 18 | For better error detection enable CONFIG_STACKTRACE, | 18 | For better error detection enable CONFIG_STACKTRACE, |
| 19 | and add slub_debug=U to boot cmdline. | 19 | and add slub_debug=U to boot cmdline. |
| 20 | 20 | ||
| 21 | config KASAN_SHADOW_OFFSET | ||
| 22 | hex | ||
| 23 | default 0xdffffc0000000000 if X86_64 | ||
| 24 | |||
| 25 | choice | 21 | choice |
| 26 | prompt "Instrumentation type" | 22 | prompt "Instrumentation type" |
| 27 | depends on KASAN | 23 | depends on KASAN |
diff --git a/lib/decompress.c b/lib/decompress.c index 528ff932d8e4..62696dff5730 100644 --- a/lib/decompress.c +++ b/lib/decompress.c | |||
| @@ -59,8 +59,11 @@ decompress_fn __init decompress_method(const unsigned char *inbuf, long len, | |||
| 59 | { | 59 | { |
| 60 | const struct compress_format *cf; | 60 | const struct compress_format *cf; |
| 61 | 61 | ||
| 62 | if (len < 2) | 62 | if (len < 2) { |
| 63 | if (name) | ||
| 64 | *name = NULL; | ||
| 63 | return NULL; /* Need at least this much... */ | 65 | return NULL; /* Need at least this much... */ |
| 66 | } | ||
| 64 | 67 | ||
| 65 | pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]); | 68 | pr_debug("Compressed data magic: %#.2x %#.2x\n", inbuf[0], inbuf[1]); |
| 66 | 69 | ||
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index ae4b65e17e64..dace71fe41f7 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
| @@ -574,6 +574,9 @@ void debug_dma_assert_idle(struct page *page) | |||
| 574 | unsigned long flags; | 574 | unsigned long flags; |
| 575 | phys_addr_t cln; | 575 | phys_addr_t cln; |
| 576 | 576 | ||
| 577 | if (dma_debug_disabled()) | ||
| 578 | return; | ||
| 579 | |||
| 577 | if (!page) | 580 | if (!page) |
| 578 | return; | 581 | return; |
| 579 | 582 | ||
diff --git a/lib/hexdump.c b/lib/hexdump.c index 7ea09699855d..8d74c20d8595 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/ctype.h> | 11 | #include <linux/ctype.h> |
| 12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
| 13 | #include <linux/export.h> | 13 | #include <linux/export.h> |
| 14 | #include <asm/unaligned.h> | ||
| 14 | 15 | ||
| 15 | const char hex_asc[] = "0123456789abcdef"; | 16 | const char hex_asc[] = "0123456789abcdef"; |
| 16 | EXPORT_SYMBOL(hex_asc); | 17 | EXPORT_SYMBOL(hex_asc); |
| @@ -139,7 +140,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, | |||
| 139 | for (j = 0; j < ngroups; j++) { | 140 | for (j = 0; j < ngroups; j++) { |
| 140 | ret = snprintf(linebuf + lx, linebuflen - lx, | 141 | ret = snprintf(linebuf + lx, linebuflen - lx, |
| 141 | "%s%16.16llx", j ? " " : "", | 142 | "%s%16.16llx", j ? " " : "", |
| 142 | (unsigned long long)*(ptr8 + j)); | 143 | get_unaligned(ptr8 + j)); |
| 143 | if (ret >= linebuflen - lx) | 144 | if (ret >= linebuflen - lx) |
| 144 | goto overflow1; | 145 | goto overflow1; |
| 145 | lx += ret; | 146 | lx += ret; |
| @@ -150,7 +151,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, | |||
| 150 | for (j = 0; j < ngroups; j++) { | 151 | for (j = 0; j < ngroups; j++) { |
| 151 | ret = snprintf(linebuf + lx, linebuflen - lx, | 152 | ret = snprintf(linebuf + lx, linebuflen - lx, |
| 152 | "%s%8.8x", j ? " " : "", | 153 | "%s%8.8x", j ? " " : "", |
| 153 | *(ptr4 + j)); | 154 | get_unaligned(ptr4 + j)); |
| 154 | if (ret >= linebuflen - lx) | 155 | if (ret >= linebuflen - lx) |
| 155 | goto overflow1; | 156 | goto overflow1; |
| 156 | lx += ret; | 157 | lx += ret; |
| @@ -161,7 +162,7 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, | |||
| 161 | for (j = 0; j < ngroups; j++) { | 162 | for (j = 0; j < ngroups; j++) { |
| 162 | ret = snprintf(linebuf + lx, linebuflen - lx, | 163 | ret = snprintf(linebuf + lx, linebuflen - lx, |
| 163 | "%s%4.4x", j ? " " : "", | 164 | "%s%4.4x", j ? " " : "", |
| 164 | *(ptr2 + j)); | 165 | get_unaligned(ptr2 + j)); |
| 165 | if (ret >= linebuflen - lx) | 166 | if (ret >= linebuflen - lx) |
| 166 | goto overflow1; | 167 | goto overflow1; |
| 167 | lx += ret; | 168 | lx += ret; |
diff --git a/lib/kobject.c b/lib/kobject.c index 2e3bd01964a9..3e3a5c3cb330 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
| @@ -337,8 +337,9 @@ error: | |||
| 337 | } | 337 | } |
| 338 | EXPORT_SYMBOL(kobject_init); | 338 | EXPORT_SYMBOL(kobject_init); |
| 339 | 339 | ||
| 340 | static int kobject_add_varg(struct kobject *kobj, struct kobject *parent, | 340 | static __printf(3, 0) int kobject_add_varg(struct kobject *kobj, |
| 341 | const char *fmt, va_list vargs) | 341 | struct kobject *parent, |
| 342 | const char *fmt, va_list vargs) | ||
| 342 | { | 343 | { |
| 343 | int retval; | 344 | int retval; |
| 344 | 345 | ||
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index a60a6d335a91..cc0c69710dcf 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
| @@ -610,6 +610,8 @@ next: | |||
| 610 | iter->skip = 0; | 610 | iter->skip = 0; |
| 611 | } | 611 | } |
| 612 | 612 | ||
| 613 | iter->p = NULL; | ||
| 614 | |||
| 613 | /* Ensure we see any new tables. */ | 615 | /* Ensure we see any new tables. */ |
| 614 | smp_rmb(); | 616 | smp_rmb(); |
| 615 | 617 | ||
| @@ -620,8 +622,6 @@ next: | |||
| 620 | return ERR_PTR(-EAGAIN); | 622 | return ERR_PTR(-EAGAIN); |
| 621 | } | 623 | } |
| 622 | 624 | ||
| 623 | iter->p = NULL; | ||
| 624 | |||
| 625 | return NULL; | 625 | return NULL; |
| 626 | } | 626 | } |
| 627 | EXPORT_SYMBOL_GPL(rhashtable_walk_next); | 627 | EXPORT_SYMBOL_GPL(rhashtable_walk_next); |
