diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2023-04-27 17:01:04 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2023-04-27 17:01:04 -0700 |
commit | 900941bea3f69859c8e4cb17e4fd89c3ff6ade99 (patch) | |
tree | fd02baba7fcf4b16e1f69e0bdae438c78d4e4870 | |
parent | 888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0 (diff) | |
parent | b69edab47f1da8edd8e7bfdf8c70f51a2a5d89fb (diff) |
Merge tag 'hardening-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull hardening update from Kees Cook:
- Fix kheaders array declaration to avoid tripping FORTIFY_SOURCE
* tag 'hardening-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux:
kheaders: Use array declaration instead of char
-rw-r--r-- | kernel/kheaders.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/kheaders.c b/kernel/kheaders.c index 8f69772af77b..42163c9e94e5 100644 --- a/kernel/kheaders.c +++ b/kernel/kheaders.c @@ -26,15 +26,15 @@ asm ( " .popsection \n" ); -extern char kernel_headers_data; -extern char kernel_headers_data_end; +extern char kernel_headers_data[]; +extern char kernel_headers_data_end[]; static ssize_t ikheaders_read(struct file *file, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t len) { - memcpy(buf, &kernel_headers_data + off, len); + memcpy(buf, &kernel_headers_data[off], len); return len; } @@ -48,8 +48,8 @@ static struct bin_attribute kheaders_attr __ro_after_init = { static int __init ikheaders_init(void) { - kheaders_attr.size = (&kernel_headers_data_end - - &kernel_headers_data); + kheaders_attr.size = (kernel_headers_data_end - + kernel_headers_data); return sysfs_create_bin_file(kernel_kobj, &kheaders_attr); } |