all changes relevant to exercise a1.3
This commit is contained in:
parent
b949dcd4b5
commit
8d67347001
@ -3755,7 +3755,7 @@ CONFIG_NVMEM_SYSFS=y
|
||||
# CONFIG_PECI is not set
|
||||
# CONFIG_HTE is not set
|
||||
CONFIG_SST=y
|
||||
CONFIG_SST_BOUNDS=y
|
||||
# CONFIG_SST_BOUNDS is useless
|
||||
# CONFIG_SST_ASYNC_SOURCE is not set
|
||||
# end of Device Drivers
|
||||
|
||||
@ -4460,7 +4460,7 @@ CONFIG_HAVE_ARCH_KASAN=y
|
||||
CONFIG_HAVE_ARCH_KASAN_VMALLOC=y
|
||||
CONFIG_CC_HAS_KASAN_GENERIC=y
|
||||
CONFIG_CC_HAS_WORKING_NOSANITIZE_ADDRESS=y
|
||||
# CONFIG_KASAN is not set
|
||||
CONFIG_KASAN=y
|
||||
CONFIG_HAVE_ARCH_KFENCE=y
|
||||
# CONFIG_KFENCE is not set
|
||||
CONFIG_HAVE_ARCH_KMSAN=y
|
||||
|
10
a1.txt
Normal file
10
a1.txt
Normal file
@ -0,0 +1,10 @@
|
||||
a) Inline: KASAN istrumentationt ist im code ausführung eingesetzt,
|
||||
um mehr Präzision bei der Erkennung von Speicherfehlern zu erreichen, während die Leistung ein wenig darunter leidet
|
||||
Outline : Instrumentierungsbezogener Code wird in einer separaten Funktion ausgeführt, wobei die Präzision zugunsten der Leistung geopfert wird.
|
||||
|
||||
b) Die wichtigste Information in den Kernel-Logs war der Stack-Trace,
|
||||
gab mir Informationen über den Übeltäter,
|
||||
außerdem enthielt der write-fehler Informationen über die Größe,
|
||||
und es wurde angedeutet, dass versucht wurde, außerhalb der bufferedbound zuzugreifen.
|
||||
für die read fehler, Die Größe der von Kasan gemeldeten Daten im Vergleich zur Größe der mit pr_debug angezeigten Daten verrät,
|
||||
dass die Anzahl der lokalen Variablen das Problem ist.
|
@ -4,3 +4,6 @@
|
||||
#
|
||||
|
||||
obj-$(CONFIG_SST) += sst_chrdev.o boundedbuffer.o sst_common.o
|
||||
CFLAGS_sst_chrdev.o := -DDEBUG
|
||||
CFLAGS_sst_common.o := -DDEBUG
|
||||
CFLAGS_boundedbuffer.o := -DDEBUG
|
@ -1,10 +1,8 @@
|
||||
#include "sst_internal.h"
|
||||
|
||||
#ifdef CONFIG_SST_BOUNDS
|
||||
#define OFFSET (4 * BOUNDEDBUFFER_SIZE)
|
||||
#else
|
||||
//this is diabloical
|
||||
#define OFFSET 0
|
||||
#endif
|
||||
|
||||
|
||||
void init_bbuffer(struct boundedbuffer *buffer) {
|
||||
buffer->next_in = 0;
|
||||
|
@ -33,7 +33,7 @@ static ssize_t universe_read(struct file *file, char __user *buf, size_t count,
|
||||
}
|
||||
len = strlen(answer);
|
||||
sst_debug("About to copy %lu bytes of your answer at 0x%lx to the userspace\n", len, (uintptr_t)answer);
|
||||
if (copy_to_user(buf, answer, count)) {
|
||||
if (copy_to_user(buf, answer, len)) {
|
||||
pr_err("User copy failed!\n");
|
||||
kfree(answer);
|
||||
return -EFAULT;
|
||||
|
Loading…
Reference in New Issue
Block a user