https://github.com/torvalds/linux
Revision 9a5c107f0c42eb7db6d70d12c8852ef6a8838a1e authored by Mike Christie on 19 December 2017, 10:03:54 UTC, committed by Bryant G. Ly on 28 February 2018, 18:55:59 UTC
We will always have a page mapped for cmd data if it is
valid command. If the mapping does not exist then something
bad happened in userspace and it should not proceed. This
has us return VM_FAULT_SIGBUS when this happens instead of
returning a freshly allocated paged. The latter can cause
corruption because userspace might write the pages data
overwriting valid data or return it to the initiator.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
1 parent bab81c3
Raw File
Tip revision: 9a5c107f0c42eb7db6d70d12c8852ef6a8838a1e authored by Mike Christie on 19 December 2017, 10:03:54 UTC
tcmu: prevent corruption when invalid data page requested
Tip revision: 9a5c107
elfcore.c
// SPDX-License-Identifier: GPL-2.0
#include <linux/elf.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/binfmts.h>

Elf_Half __weak elf_core_extra_phdrs(void)
{
	return 0;
}

int __weak elf_core_write_extra_phdrs(struct coredump_params *cprm, loff_t offset)
{
	return 1;
}

int __weak elf_core_write_extra_data(struct coredump_params *cprm)
{
	return 1;
}

size_t __weak elf_core_extra_data_size(void)
{
	return 0;
}
back to top