diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bitmap.c | 4 | ||||
| -rw-r--r-- | lib/clz_ctz.c | 4 | ||||
| -rw-r--r-- | lib/cmdline.c | 5 | ||||
| -rw-r--r-- | lib/cpu_rmap.c | 5 | ||||
| -rw-r--r-- | lib/crc-ccitt.c | 4 | ||||
| -rw-r--r-- | lib/crc-itu-t.c | 4 | ||||
| -rw-r--r-- | lib/crc-t10dif.c | 4 | ||||
| -rw-r--r-- | lib/crc16.c | 4 | ||||
| -rw-r--r-- | lib/crc4.c | 4 | ||||
| -rw-r--r-- | lib/crc7.c | 4 | ||||
| -rw-r--r-- | lib/decompress_unlz4.c | 5 | ||||
| -rw-r--r-- | lib/genalloc.c | 4 | ||||
| -rw-r--r-- | lib/hexdump.c | 6 | ||||
| -rw-r--r-- | lib/iomap_copy.c | 14 | ||||
| -rw-r--r-- | lib/jedec_ddr_data.c | 5 | ||||
| -rw-r--r-- | lib/klist.c | 3 | ||||
| -rw-r--r-- | lib/parser.c | 4 | ||||
| -rw-r--r-- | lib/raid6/neon.c | 5 | ||||
| -rw-r--r-- | lib/rhashtable.c | 5 | ||||
| -rw-r--r-- | lib/scatterlist.c | 4 | ||||
| -rw-r--r-- | lib/sg_split.c | 4 | ||||
| -rw-r--r-- | lib/test_kasan.c | 6 | ||||
| -rw-r--r-- | lib/test_rhashtable.c | 5 | ||||
| -rw-r--r-- | lib/test_stackinit.c | 21 | ||||
| -rw-r--r-- | lib/ubsan.c | 6 |
25 files changed, 39 insertions, 100 deletions
diff --git a/lib/bitmap.c b/lib/bitmap.c index f235434df87b..bbe2589e8497 100644 --- a/lib/bitmap.c +++ b/lib/bitmap.c | |||
| @@ -1,9 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * lib/bitmap.c | 3 | * lib/bitmap.c |
| 3 | * Helper functions for bitmap.h. | 4 | * Helper functions for bitmap.h. |
| 4 | * | ||
| 5 | * This source code is licensed under the GNU General Public License, | ||
| 6 | * Version 2. See the file COPYING for more details. | ||
| 7 | */ | 5 | */ |
| 8 | #include <linux/export.h> | 6 | #include <linux/export.h> |
| 9 | #include <linux/thread_info.h> | 7 | #include <linux/thread_info.h> |
diff --git a/lib/clz_ctz.c b/lib/clz_ctz.c index 2e11e48446ab..0d3a686b5ba2 100644 --- a/lib/clz_ctz.c +++ b/lib/clz_ctz.c | |||
| @@ -1,11 +1,9 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * lib/clz_ctz.c | 3 | * lib/clz_ctz.c |
| 3 | * | 4 | * |
| 4 | * Copyright (C) 2013 Chanho Min <chanho.min@lge.com> | 5 | * Copyright (C) 2013 Chanho Min <chanho.min@lge.com> |
| 5 | * | 6 | * |
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * The functions in this file aren't called directly, but are required by | 7 | * The functions in this file aren't called directly, but are required by |
| 10 | * GCC builtins such as __builtin_ctz, and therefore they can't be removed | 8 | * GCC builtins such as __builtin_ctz, and therefore they can't be removed |
| 11 | * despite appearing unreferenced in kernel source. | 9 | * despite appearing unreferenced in kernel source. |
diff --git a/lib/cmdline.c b/lib/cmdline.c index dc59d6216318..fbb9981a04a4 100644 --- a/lib/cmdline.c +++ b/lib/cmdline.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * linux/lib/cmdline.c | 3 | * linux/lib/cmdline.c |
| 3 | * Helper functions generally used for parsing kernel command line | 4 | * Helper functions generally used for parsing kernel command line |
| @@ -5,11 +6,7 @@ | |||
| 5 | * | 6 | * |
| 6 | * Code and copyrights come from init/main.c and arch/i386/kernel/setup.c. | 7 | * Code and copyrights come from init/main.c and arch/i386/kernel/setup.c. |
| 7 | * | 8 | * |
| 8 | * This source code is licensed under the GNU General Public License, | ||
| 9 | * Version 2. See the file COPYING for more details. | ||
| 10 | * | ||
| 11 | * GNU Indent formatting options for this file: -kr -i8 -npsl -pcs | 9 | * GNU Indent formatting options for this file: -kr -i8 -npsl -pcs |
| 12 | * | ||
| 13 | */ | 10 | */ |
| 14 | 11 | ||
| 15 | #include <linux/export.h> | 12 | #include <linux/export.h> |
diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c index f610b2a10b3e..075f3788bbe4 100644 --- a/lib/cpu_rmap.c +++ b/lib/cpu_rmap.c | |||
| @@ -1,10 +1,7 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * cpu_rmap.c: CPU affinity reverse-map support | 3 | * cpu_rmap.c: CPU affinity reverse-map support |
| 3 | * Copyright 2011 Solarflare Communications Inc. | 4 | * Copyright 2011 Solarflare Communications Inc. |
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms of the GNU General Public License version 2 as published | ||
| 7 | * by the Free Software Foundation, incorporated herein by reference. | ||
| 8 | */ | 5 | */ |
| 9 | 6 | ||
| 10 | #include <linux/cpu_rmap.h> | 7 | #include <linux/cpu_rmap.h> |
diff --git a/lib/crc-ccitt.c b/lib/crc-ccitt.c index d873b34039ff..d1a7d29d2ac9 100644 --- a/lib/crc-ccitt.c +++ b/lib/crc-ccitt.c | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * linux/lib/crc-ccitt.c | 3 | * linux/lib/crc-ccitt.c |
| 3 | * | ||
| 4 | * This source code is licensed under the GNU General Public License, | ||
| 5 | * Version 2. See the file COPYING for more details. | ||
| 6 | */ | 4 | */ |
| 7 | 5 | ||
| 8 | #include <linux/types.h> | 6 | #include <linux/types.h> |
diff --git a/lib/crc-itu-t.c b/lib/crc-itu-t.c index b3219d0abfb4..1974b355c148 100644 --- a/lib/crc-itu-t.c +++ b/lib/crc-itu-t.c | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * crc-itu-t.c | 3 | * crc-itu-t.c |
| 3 | * | ||
| 4 | * This source code is licensed under the GNU General Public License, | ||
| 5 | * Version 2. See the file COPYING for more details. | ||
| 6 | */ | 4 | */ |
| 7 | 5 | ||
| 8 | #include <linux/types.h> | 6 | #include <linux/types.h> |
diff --git a/lib/crc-t10dif.c b/lib/crc-t10dif.c index e89ebfdbb0fc..8cc01a603416 100644 --- a/lib/crc-t10dif.c +++ b/lib/crc-t10dif.c | |||
| @@ -1,11 +1,9 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * T10 Data Integrity Field CRC16 calculation | 3 | * T10 Data Integrity Field CRC16 calculation |
| 3 | * | 4 | * |
| 4 | * Copyright (c) 2007 Oracle Corporation. All rights reserved. | 5 | * Copyright (c) 2007 Oracle Corporation. All rights reserved. |
| 5 | * Written by Martin K. Petersen <martin.petersen@oracle.com> | 6 | * Written by Martin K. Petersen <martin.petersen@oracle.com> |
| 6 | * | ||
| 7 | * This source code is licensed under the GNU General Public License, | ||
| 8 | * Version 2. See the file COPYING for more details. | ||
| 9 | */ | 7 | */ |
| 10 | 8 | ||
| 11 | #include <linux/types.h> | 9 | #include <linux/types.h> |
diff --git a/lib/crc16.c b/lib/crc16.c index 8737b084d1f9..5c3a803c01e0 100644 --- a/lib/crc16.c +++ b/lib/crc16.c | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * crc16.c | 3 | * crc16.c |
| 3 | * | ||
| 4 | * This source code is licensed under the GNU General Public License, | ||
| 5 | * Version 2. See the file COPYING for more details. | ||
| 6 | */ | 4 | */ |
| 7 | 5 | ||
| 8 | #include <linux/types.h> | 6 | #include <linux/types.h> |
diff --git a/lib/crc4.c b/lib/crc4.c index 164ed9444cd3..e7e1779c67d9 100644 --- a/lib/crc4.c +++ b/lib/crc4.c | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * crc4.c - simple crc-4 calculations. | 3 | * crc4.c - simple crc-4 calculations. |
| 3 | * | ||
| 4 | * This source code is licensed under the GNU General Public License, Version | ||
| 5 | * 2. See the file COPYING for more details. | ||
| 6 | */ | 4 | */ |
| 7 | 5 | ||
| 8 | #include <linux/crc4.h> | 6 | #include <linux/crc4.h> |
diff --git a/lib/crc7.c b/lib/crc7.c index bf6255e23919..6a848d73e804 100644 --- a/lib/crc7.c +++ b/lib/crc7.c | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * crc7.c | 3 | * crc7.c |
| 3 | * | ||
| 4 | * This source code is licensed under the GNU General Public License, | ||
| 5 | * Version 2. See the file COPYING for more details. | ||
| 6 | */ | 4 | */ |
| 7 | 5 | ||
| 8 | #include <linux/types.h> | 6 | #include <linux/types.h> |
diff --git a/lib/decompress_unlz4.c b/lib/decompress_unlz4.c index 1b0baf3008ea..c0cfcfd486be 100644 --- a/lib/decompress_unlz4.c +++ b/lib/decompress_unlz4.c | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Wrapper for decompressing LZ4-compressed kernel, initramfs, and initrd | 3 | * Wrapper for decompressing LZ4-compressed kernel, initramfs, and initrd |
| 3 | * | 4 | * |
| 4 | * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com> | 5 | * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.com> |
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | 6 | */ |
| 10 | 7 | ||
| 11 | #ifdef STATIC | 8 | #ifdef STATIC |
diff --git a/lib/genalloc.c b/lib/genalloc.c index 770c769d7cb7..5257f74fccf3 100644 --- a/lib/genalloc.c +++ b/lib/genalloc.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Basic general purpose allocator for managing special purpose | 3 | * Basic general purpose allocator for managing special purpose |
| 3 | * memory, for example, memory that is not managed by the regular | 4 | * memory, for example, memory that is not managed by the regular |
| @@ -23,9 +24,6 @@ | |||
| 23 | * CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. | 24 | * CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG. |
| 24 | * | 25 | * |
| 25 | * Copyright 2005 (C) Jes Sorensen <jes@trained-monkey.org> | 26 | * Copyright 2005 (C) Jes Sorensen <jes@trained-monkey.org> |
| 26 | * | ||
| 27 | * This source code is licensed under the GNU General Public License, | ||
| 28 | * Version 2. See the file COPYING for more details. | ||
| 29 | */ | 27 | */ |
| 30 | 28 | ||
| 31 | #include <linux/slab.h> | 29 | #include <linux/slab.h> |
diff --git a/lib/hexdump.c b/lib/hexdump.c index 81b70ed37209..b1d55b669ae2 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c | |||
| @@ -1,10 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * lib/hexdump.c | 3 | * lib/hexdump.c |
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 as | ||
| 6 | * published by the Free Software Foundation. See README and COPYING for | ||
| 7 | * more details. | ||
| 8 | */ | 4 | */ |
| 9 | 5 | ||
| 10 | #include <linux/types.h> | 6 | #include <linux/types.h> |
diff --git a/lib/iomap_copy.c b/lib/iomap_copy.c index b8f1d6cbb200..5de7c04e05ef 100644 --- a/lib/iomap_copy.c +++ b/lib/iomap_copy.c | |||
| @@ -1,18 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Copyright 2006 PathScale, Inc. All Rights Reserved. | 3 | * Copyright 2006 PathScale, Inc. All Rights Reserved. |
| 3 | * | ||
| 4 | * This file is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of version 2 of the GNU General Public License | ||
| 6 | * as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program; if not, write to the Free Software Foundation, | ||
| 15 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| 16 | */ | 4 | */ |
| 17 | 5 | ||
| 18 | #include <linux/export.h> | 6 | #include <linux/export.h> |
diff --git a/lib/jedec_ddr_data.c b/lib/jedec_ddr_data.c index 6d2cbf1d567f..d0b312e28d36 100644 --- a/lib/jedec_ddr_data.c +++ b/lib/jedec_ddr_data.c | |||
| @@ -1,13 +1,10 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * DDR addressing details and AC timing parameters from JEDEC specs | 3 | * DDR addressing details and AC timing parameters from JEDEC specs |
| 3 | * | 4 | * |
| 4 | * Copyright (C) 2012 Texas Instruments, Inc. | 5 | * Copyright (C) 2012 Texas Instruments, Inc. |
| 5 | * | 6 | * |
| 6 | * Aneesh V <aneesh@ti.com> | 7 | * Aneesh V <aneesh@ti.com> |
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | 8 | */ |
| 12 | 9 | ||
| 13 | #include <memory/jedec_ddr.h> | 10 | #include <memory/jedec_ddr.h> |
diff --git a/lib/klist.c b/lib/klist.c index f6b547812fe3..332a4fbf18ff 100644 --- a/lib/klist.c +++ b/lib/klist.c | |||
| @@ -1,10 +1,9 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * klist.c - Routines for manipulating klists. | 3 | * klist.c - Routines for manipulating klists. |
| 3 | * | 4 | * |
| 4 | * Copyright (C) 2005 Patrick Mochel | 5 | * Copyright (C) 2005 Patrick Mochel |
| 5 | * | 6 | * |
| 6 | * This file is released under the GPL v2. | ||
| 7 | * | ||
| 8 | * This klist interface provides a couple of structures that wrap around | 7 | * This klist interface provides a couple of structures that wrap around |
| 9 | * struct list_head to provide explicit list "head" (struct klist) and list | 8 | * struct list_head to provide explicit list "head" (struct klist) and list |
| 10 | * "node" (struct klist_node) objects. For struct klist, a spinlock is | 9 | * "node" (struct klist_node) objects. For struct klist, a spinlock is |
diff --git a/lib/parser.c b/lib/parser.c index dd70e5e6c9e2..f5b3e5d7a7f9 100644 --- a/lib/parser.c +++ b/lib/parser.c | |||
| @@ -1,8 +1,6 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * lib/parser.c - simple parser for mount, etc. options. | 3 | * lib/parser.c - simple parser for mount, etc. options. |
| 3 | * | ||
| 4 | * This source code is licensed under the GNU General Public License, | ||
| 5 | * Version 2. See the file COPYING for more details. | ||
| 6 | */ | 4 | */ |
| 7 | 5 | ||
| 8 | #include <linux/ctype.h> | 6 | #include <linux/ctype.h> |
diff --git a/lib/raid6/neon.c b/lib/raid6/neon.c index 7076ef1ba3dd..0a2e76035ea9 100644 --- a/lib/raid6/neon.c +++ b/lib/raid6/neon.c | |||
| @@ -1,11 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * linux/lib/raid6/neon.c - RAID6 syndrome calculation using ARM NEON intrinsics | 3 | * linux/lib/raid6/neon.c - RAID6 syndrome calculation using ARM NEON intrinsics |
| 3 | * | 4 | * |
| 4 | * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org> | 5 | * Copyright (C) 2013 Linaro Ltd <ard.biesheuvel@linaro.org> |
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | 6 | */ |
| 10 | 7 | ||
| 11 | #include <linux/raid/pq.h> | 8 | #include <linux/raid/pq.h> |
diff --git a/lib/rhashtable.c b/lib/rhashtable.c index 935ec80f213f..bdb7e4cadf05 100644 --- a/lib/rhashtable.c +++ b/lib/rhashtable.c | |||
| @@ -1,3 +1,4 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Resizable, Scalable, Concurrent Hash Table | 3 | * Resizable, Scalable, Concurrent Hash Table |
| 3 | * | 4 | * |
| @@ -8,10 +9,6 @@ | |||
| 8 | * Code partially derived from nft_hash | 9 | * Code partially derived from nft_hash |
| 9 | * Rewritten with rehash code from br_multicast plus single list | 10 | * Rewritten with rehash code from br_multicast plus single list |
| 10 | * pointer as suggested by Josh Triplett | 11 | * pointer as suggested by Josh Triplett |
| 11 | * | ||
| 12 | * This program is free software; you can redistribute it and/or modify | ||
| 13 | * it under the terms of the GNU General Public License version 2 as | ||
| 14 | * published by the Free Software Foundation. | ||
| 15 | */ | 12 | */ |
| 16 | 13 | ||
| 17 | #include <linux/atomic.h> | 14 | #include <linux/atomic.h> |
diff --git a/lib/scatterlist.c b/lib/scatterlist.c index 739dc9fe2c55..2882d9ba6607 100644 --- a/lib/scatterlist.c +++ b/lib/scatterlist.c | |||
| @@ -1,10 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com> | 3 | * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com> |
| 3 | * | 4 | * |
| 4 | * Scatterlist handling helpers. | 5 | * Scatterlist handling helpers. |
| 5 | * | ||
| 6 | * This source code is licensed under the GNU General Public License, | ||
| 7 | * Version 2. See the file COPYING for more details. | ||
| 8 | */ | 6 | */ |
| 9 | #include <linux/export.h> | 7 | #include <linux/export.h> |
| 10 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
diff --git a/lib/sg_split.c b/lib/sg_split.c index b063410c3593..9982c63d1063 100644 --- a/lib/sg_split.c +++ b/lib/sg_split.c | |||
| @@ -1,10 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Copyright (C) 2015 Robert Jarzmik <robert.jarzmik@free.fr> | 3 | * Copyright (C) 2015 Robert Jarzmik <robert.jarzmik@free.fr> |
| 3 | * | 4 | * |
| 4 | * Scatterlist splitting helpers. | 5 | * Scatterlist splitting helpers. |
| 5 | * | ||
| 6 | * This source code is licensed under the GNU General Public License, | ||
| 7 | * Version 2. See the file COPYING for more details. | ||
| 8 | */ | 6 | */ |
| 9 | 7 | ||
| 10 | #include <linux/scatterlist.h> | 8 | #include <linux/scatterlist.h> |
diff --git a/lib/test_kasan.c b/lib/test_kasan.c index 7de2702621dc..e3c593c38eff 100644 --- a/lib/test_kasan.c +++ b/lib/test_kasan.c | |||
| @@ -1,12 +1,8 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * | 3 | * |
| 3 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | 4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. |
| 4 | * Author: Andrey Ryabinin <a.ryabinin@samsung.com> | 5 | * Author: Andrey Ryabinin <a.ryabinin@samsung.com> |
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | */ | 6 | */ |
| 11 | 7 | ||
| 12 | #define pr_fmt(fmt) "kasan test: %s " fmt, __func__ | 8 | #define pr_fmt(fmt) "kasan test: %s " fmt, __func__ |
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c index 084fe5a6ac57..c5a6fef7b45d 100644 --- a/lib/test_rhashtable.c +++ b/lib/test_rhashtable.c | |||
| @@ -1,12 +1,9 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * Resizable, Scalable, Concurrent Hash Table | 3 | * Resizable, Scalable, Concurrent Hash Table |
| 3 | * | 4 | * |
| 4 | * Copyright (c) 2014-2015 Thomas Graf <tgraf@suug.ch> | 5 | * Copyright (c) 2014-2015 Thomas Graf <tgraf@suug.ch> |
| 5 | * Copyright (c) 2008-2014 Patrick McHardy <kaber@trash.net> | 6 | * Copyright (c) 2008-2014 Patrick McHardy <kaber@trash.net> |
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | */ | 7 | */ |
| 11 | 8 | ||
| 12 | /************************************************************************** | 9 | /************************************************************************** |
diff --git a/lib/test_stackinit.c b/lib/test_stackinit.c index e97dc54b4fdf..2d7d257a430e 100644 --- a/lib/test_stackinit.c +++ b/lib/test_stackinit.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | /* Exfiltration buffer. */ | 13 | /* Exfiltration buffer. */ |
| 14 | #define MAX_VAR_SIZE 128 | 14 | #define MAX_VAR_SIZE 128 |
| 15 | static char check_buf[MAX_VAR_SIZE]; | 15 | static u8 check_buf[MAX_VAR_SIZE]; |
| 16 | 16 | ||
| 17 | /* Character array to trigger stack protector in all functions. */ | 17 | /* Character array to trigger stack protector in all functions. */ |
| 18 | #define VAR_BUFFER 32 | 18 | #define VAR_BUFFER 32 |
| @@ -106,9 +106,18 @@ static noinline __init int test_ ## name (void) \ | |||
| 106 | \ | 106 | \ |
| 107 | /* Fill clone type with zero for per-field init. */ \ | 107 | /* Fill clone type with zero for per-field init. */ \ |
| 108 | memset(&zero, 0x00, sizeof(zero)); \ | 108 | memset(&zero, 0x00, sizeof(zero)); \ |
| 109 | /* Clear entire check buffer for 0xFF overlap test. */ \ | ||
| 110 | memset(check_buf, 0x00, sizeof(check_buf)); \ | ||
| 109 | /* Fill stack with 0xFF. */ \ | 111 | /* Fill stack with 0xFF. */ \ |
| 110 | ignored = leaf_ ##name((unsigned long)&ignored, 1, \ | 112 | ignored = leaf_ ##name((unsigned long)&ignored, 1, \ |
| 111 | FETCH_ARG_ ## which(zero)); \ | 113 | FETCH_ARG_ ## which(zero)); \ |
| 114 | /* Verify all bytes overwritten with 0xFF. */ \ | ||
| 115 | for (sum = 0, i = 0; i < target_size; i++) \ | ||
| 116 | sum += (check_buf[i] != 0xFF); \ | ||
| 117 | if (sum) { \ | ||
| 118 | pr_err(#name ": leaf fill was not 0xFF!?\n"); \ | ||
| 119 | return 1; \ | ||
| 120 | } \ | ||
| 112 | /* Clear entire check buffer for later bit tests. */ \ | 121 | /* Clear entire check buffer for later bit tests. */ \ |
| 113 | memset(check_buf, 0x00, sizeof(check_buf)); \ | 122 | memset(check_buf, 0x00, sizeof(check_buf)); \ |
| 114 | /* Extract stack-defined variable contents. */ \ | 123 | /* Extract stack-defined variable contents. */ \ |
| @@ -126,9 +135,9 @@ static noinline __init int test_ ## name (void) \ | |||
| 126 | return 1; \ | 135 | return 1; \ |
| 127 | } \ | 136 | } \ |
| 128 | \ | 137 | \ |
| 129 | /* Look for any set bits in the check region. */ \ | 138 | /* Look for any bytes still 0xFF in check region. */ \ |
| 130 | for (i = 0; i < sizeof(check_buf); i++) \ | 139 | for (sum = 0, i = 0; i < target_size; i++) \ |
| 131 | sum += (check_buf[i] != 0); \ | 140 | sum += (check_buf[i] == 0xFF); \ |
| 132 | \ | 141 | \ |
| 133 | if (sum == 0) \ | 142 | if (sum == 0) \ |
| 134 | pr_info(#name " ok\n"); \ | 143 | pr_info(#name " ok\n"); \ |
| @@ -162,13 +171,13 @@ static noinline __init int leaf_ ## name(unsigned long sp, \ | |||
| 162 | * Keep this buffer around to make sure we've got a \ | 171 | * Keep this buffer around to make sure we've got a \ |
| 163 | * stack frame of SOME kind... \ | 172 | * stack frame of SOME kind... \ |
| 164 | */ \ | 173 | */ \ |
| 165 | memset(buf, (char)(sp && 0xff), sizeof(buf)); \ | 174 | memset(buf, (char)(sp & 0xff), sizeof(buf)); \ |
| 166 | /* Fill variable with 0xFF. */ \ | 175 | /* Fill variable with 0xFF. */ \ |
| 167 | if (fill) { \ | 176 | if (fill) { \ |
| 168 | fill_start = &var; \ | 177 | fill_start = &var; \ |
| 169 | fill_size = sizeof(var); \ | 178 | fill_size = sizeof(var); \ |
| 170 | memset(fill_start, \ | 179 | memset(fill_start, \ |
| 171 | (char)((sp && 0xff) | forced_mask), \ | 180 | (char)((sp & 0xff) | forced_mask), \ |
| 172 | fill_size); \ | 181 | fill_size); \ |
| 173 | } \ | 182 | } \ |
| 174 | \ | 183 | \ |
diff --git a/lib/ubsan.c b/lib/ubsan.c index ecc179338094..e7d31735950d 100644 --- a/lib/ubsan.c +++ b/lib/ubsan.c | |||
| @@ -1,13 +1,9 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0-only | ||
| 1 | /* | 2 | /* |
| 2 | * UBSAN error reporting functions | 3 | * UBSAN error reporting functions |
| 3 | * | 4 | * |
| 4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. | 5 | * Copyright (c) 2014 Samsung Electronics Co., Ltd. |
| 5 | * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com> | 6 | * Author: Andrey Ryabinin <ryabinin.a.a@gmail.com> |
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | */ | 7 | */ |
| 12 | 8 | ||
| 13 | #include <linux/bitops.h> | 9 | #include <linux/bitops.h> |
