linux-yocto/kernel
Daniel Thompson 474c8749d7 kdb: Eliminate strncpy() warnings by replacing with strscpy()
commit d228bee820 upstream

Currently the code to manage the kdb history buffer uses strncpy() to
copy strings to/and from the history and exhibits the classic "but
nobody ever told me that strncpy() doesn't always terminate strings"
bug. Modern gcc compilers recognise this bug and issue a warning.

In reality these calls will only abridge the copied string if kdb_read()
has *already* overflowed the command buffer. Thus the use of counted
copies here is only used to reduce the secondary effects of a bug
elsewhere in the code.

Therefore transitioning these calls into strscpy() (without checking
the return code) is appropriate.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2020-11-19 10:17:12 -05:00
..
bpf bpf: Fix map leak in HASH_OF_MAPS map 2020-08-21 14:47:48 -04:00
cgroup cgroup: fix cgroup_sk_alloc() for sk_clone_lock() 2020-08-13 15:30:09 -04:00
configs
debug kdb: Eliminate strncpy() warnings by replacing with strscpy() 2020-11-19 10:17:12 -05:00
dma dma-direct: fix data truncation in dma_direct_get_required_mask() 2020-06-04 16:26:39 -04:00
events uprobes: Change handle_swbp() to send SIGTRAP with si_code=SI_KERNEL, to fix GDB regression 2020-08-18 18:36:04 -04:00
gcov kernel/gcov/fs.c: gcov_seq_next() should increase position index 2020-06-04 16:26:39 -04:00
irq genirq/affinity: Make affinity setting if activated opt-in 2020-08-13 15:30:48 -04:00
livepatch livepatch: Nullify obj->mod in klp_module_coming()'s error path 2019-10-07 18:59:28 +02:00
locking Merge tag 'v5.2.46' into v5.2/standard/base 2020-06-29 23:41:20 -04:00
power PM: hibernate: Freeze kernel threads in software_resume() 2020-06-04 16:27:56 -04:00
printk printk: queue wake_up_klogd irq_work only if per-CPU areas are ready 2020-06-04 16:27:22 -04:00
rcu rcu: Add support for consolidated-RCU reader checking 2020-05-21 19:05:33 -04:00
sched sched: correct SD_flags returned by tl->sd_flags() 2020-09-04 10:33:04 -04:00
time timer: Fix wheel index calculation on last level 2020-08-13 15:30:39 -04:00
trace Merge tag 'v5.2.60' into v5.2/standard/base 2020-09-21 17:02:29 -04:00
.gitignore Provide in-kernel headers to make extending kernel easier 2019-04-29 16:48:03 +02:00
acct.c acct_on(): don't mess with freeze protection 2019-04-04 21:04:13 -04:00
async.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
audit_fsnotify.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
audit_tree.c fsnotify: switch send_to_group() and ->handle_event to const struct qstr * 2019-04-26 13:51:03 -04:00
audit_watch.c audit_get_nd(): don't unlock parent too early 2020-01-19 14:47:56 -05:00
audit.c audit: fix a net reference leak in audit_list_rules_send() 2020-07-11 12:35:02 -04:00
audit.h audit: fix a net reference leak in audit_list_rules_send() 2020-07-11 12:35:02 -04:00
auditfilter.c audit: fix a net reference leak in audit_list_rules_send() 2020-07-11 12:35:02 -04:00
auditsc.c Merge branch 'work.dcache' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2019-05-07 20:03:32 -07:00
backtracetest.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
bounds.c
capability.c LSM: add SafeSetID module that gates setid calls 2019-01-25 11:22:43 -08:00
compat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
configs.c kernel/configs: use .incbin directive to embed config_data.gz 2019-03-07 18:32:02 -08:00
context_tracking.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
cpu_pm.c kernel/cpu_pm: Fix uninitted local in cpu_pm 2020-07-11 12:35:34 -04:00
cpu.c sched/core: Fix illegal RCU from offline CPUs 2020-07-11 12:35:04 -04:00
crash_core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230 2019-06-19 17:09:06 +02:00
crash_dump.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
cred.c memcg: account security cred as well to kmemcg 2020-03-20 23:10:31 -04:00
delayacct.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25 2019-05-21 11:52:39 +02:00
dma.c
elfcore.c kernel/elfcore.c: include proper prototypes 2019-11-09 19:33:17 -05:00
exec_domain.c
exit.c exit: Move preemption fixup up, move blocking operations down 2020-07-11 12:35:04 -04:00
extable.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
fail_function.c treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
fork.c This is the 5.2.22 stable release 2019-11-10 22:06:14 -05:00
freezer.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
futex.c futex: Unbreak futex hashing 2020-05-21 19:07:34 -04:00
gen_kheaders.sh kheaders: Do not regenerate archive if config is not changed 2019-05-24 20:16:01 +02:00
groups.c
hung_task.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
iomem.c mm/nvdimm: add is_ioremap_addr and use that to check ioremap address 2019-07-26 09:11:06 +02:00
irq_work.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
jump_label.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
kallsyms.c kallsyms: Refactor kallsyms_show_value() to take cred 2020-08-03 14:03:36 -04:00
kcmp.c
Kconfig.freezer treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.hz treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.locks treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Kconfig.preempt treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
kcov.c kcov: convert kcov.refcount to refcount_t 2019-03-07 18:32:02 -08:00
kexec_core.c kexec: bail out upon SIGKILL when allocating memory. 2019-10-07 18:59:40 +02:00
kexec_file.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230 2019-06-19 17:09:06 +02:00
kexec_internal.h
kexec.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 230 2019-06-19 17:09:06 +02:00
kheaders.c kheaders: Move from proc to sysfs 2019-05-24 20:16:01 +02:00
kmod.c kmod: make request_module() return an error when autoloading is disabled 2020-06-01 20:26:54 -04:00
kprobes.c kprobes: Fix compiler warning for !CONFIG_KPROBES_ON_FTRACE 2020-09-17 17:26:22 -04:00
ksysfs.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 170 2019-05-30 11:26:39 -07:00
kthread.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
latencytop.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
Makefile uptime: allow the optional limiting of kernel runtime 2019-07-22 10:55:18 -04:00
memremap.c mm/devm_memremap_pages: fix final page put race 2019-06-13 17:34:56 -10:00
module_signing.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
module-internal.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 36 2019-05-24 17:27:11 +02:00
module.c module: Correctly truncate sysfs sections output 2020-08-13 15:30:49 -04:00
notifier.c x86/mm: split vmalloc_sync_all() 2020-04-12 00:07:28 -04:00
nsproxy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
padata.c padata: always acquire cpu_hotplug_lock before pinst->lock 2020-06-01 20:25:44 -04:00
panic.c bug: consolidate __WARN_FLAGS usage 2020-04-12 00:07:25 -04:00
params.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
pid_namespace.c signal/pid_namespace: Fix reboot_pid_ns to use send_sig not force_sig 2019-07-26 09:10:16 +02:00
pid.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
profile.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
ptrace.c ptrace: reintroduce usage of subjective credentials in ptrace_has_cap() 2020-04-12 00:07:55 -04:00
range.c
reboot.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
relay.c kernel/relay.c: handle alloc_percpu returning NULL in relay_open 2020-06-09 16:30:55 -04:00
resource.c resource: fix locking in find_next_iomem_res() 2019-07-26 09:11:07 +02:00
rseq.c rseq: Remove superfluous rseq_len from task_struct 2019-04-19 12:39:32 +02:00
seccomp.c seccomp: Fix ioctl number for SECCOMP_IOCTL_NOTIF_ID_VALID 2020-09-04 10:33:11 -04:00
signal.c signal: check sig before setting info in kill_pid_usb_asyncio 2020-06-04 16:27:38 -04:00
smp.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
smpboot.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
smpboot.h
softirq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 430 2019-06-05 17:37:16 +02:00
stackleak.c
stacktrace.c stacktrace: Don't skip first entry on noncurrent tasks 2020-01-19 14:47:24 -05:00
stop_machine.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 38 2019-05-24 17:27:11 +02:00
sys_ni.c signal: support CLONE_PIDFD with pidfd_send_signal 2019-05-07 14:31:03 +02:00
sys.c prctl_set_mm: downgrade mmap_sem to read lock 2019-06-01 15:51:31 -07:00
sysctl_binary.c kernel/sysctl: add panic_print into sysctl 2019-01-04 13:13:47 -08:00
sysctl.c kernel: sysctl: make drop_caches write-only 2020-03-07 18:24:46 -05:00
task_work.c aufs5: standalone support 2019-07-22 10:55:11 -04:00
taskstats.c taskstats: fix data-race 2020-03-20 23:10:24 -04:00
test_kprobes.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 25 2019-05-21 11:52:39 +02:00
torture.c torture: Don't try to offline the last CPU 2019-03-26 14:42:53 -07:00
tracepoint.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
tsacct.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
ucount.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
uid16.c
uid16.h
umh.c umh: fix memory leak on execve failure 2020-06-08 13:46:23 -04:00
up.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
uptime_limit.c uptime: allow the optional limiting of kernel runtime 2019-07-22 10:55:18 -04:00
user_namespace.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
user-return-notifier.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
user.c treewide: Add SPDX license identifier for missed files 2019-05-21 10:50:45 +02:00
utsname_sysctl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
utsname.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441 2019-06-05 17:37:17 +02:00
watchdog_hld.c kernel/watchdog_hld.c: hard lockup message should end with a newline 2019-04-19 09:46:05 -07:00
watchdog.c watchdog/softlockup: Enforce that timestamp is valid on boot 2020-05-15 17:16:45 -04:00
workqueue_internal.h sched/core, workqueues: Distangle worker accounting from rq lock 2019-04-16 16:55:15 +02:00
workqueue.c workqueue: Remove unnecessary kfree() call in rcu_free_wq() 2020-06-01 20:28:03 -04:00