diff options
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/addr-map.c | 4 | ||||
-rw-r--r-- | runtime/staprun/modverify.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/runtime/addr-map.c b/runtime/addr-map.c index 8c0e84d8..a9aa8d88 100644 --- a/runtime/addr-map.c +++ b/runtime/addr-map.c @@ -110,6 +110,10 @@ lookup_bad_addr(unsigned long addr, size_t size) { struct addr_map_entry* result = 0; + /* Is this a valid memory access? */ + if (size == 0 || ULONG_MAX - addr < size - 1) + return 1; + #ifndef STP_PRIVILEGED /* Unprivileged users must not access kernel space memory. */ if (addr + size > TASK_SIZE) diff --git a/runtime/staprun/modverify.c b/runtime/staprun/modverify.c index 6dc192b2..059856ee 100644 --- a/runtime/staprun/modverify.c +++ b/runtime/staprun/modverify.c @@ -146,7 +146,7 @@ check_cert_db_permissions (const char *cert_db_path) { if (info.st_uid != 0) { fprintf (stderr, "Certificate database directory %s must be owned by root.\n", cert_db_path); - rc = 0; + return 0; } rc = 1; /* ok */ |