diff options
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index 9c970167e402..60bafbed06ab 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -932,6 +932,7 @@ static int kimage_load_segment(struct kimage *image, | |||
932 | */ | 932 | */ |
933 | struct kimage *kexec_image; | 933 | struct kimage *kexec_image; |
934 | struct kimage *kexec_crash_image; | 934 | struct kimage *kexec_crash_image; |
935 | int kexec_load_disabled; | ||
935 | 936 | ||
936 | static DEFINE_MUTEX(kexec_mutex); | 937 | static DEFINE_MUTEX(kexec_mutex); |
937 | 938 | ||
@@ -942,7 +943,7 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, unsigned long, nr_segments, | |||
942 | int result; | 943 | int result; |
943 | 944 | ||
944 | /* We only trust the superuser with rebooting the system. */ | 945 | /* We only trust the superuser with rebooting the system. */ |
945 | if (!capable(CAP_SYS_BOOT)) | 946 | if (!capable(CAP_SYS_BOOT) || kexec_load_disabled) |
946 | return -EPERM; | 947 | return -EPERM; |
947 | 948 | ||
948 | /* | 949 | /* |
@@ -1536,7 +1537,7 @@ void vmcoreinfo_append_str(const char *fmt, ...) | |||
1536 | size_t r; | 1537 | size_t r; |
1537 | 1538 | ||
1538 | va_start(args, fmt); | 1539 | va_start(args, fmt); |
1539 | r = vsnprintf(buf, sizeof(buf), fmt, args); | 1540 | r = vscnprintf(buf, sizeof(buf), fmt, args); |
1540 | va_end(args); | 1541 | va_end(args); |
1541 | 1542 | ||
1542 | r = min(r, vmcoreinfo_max_size - vmcoreinfo_size); | 1543 | r = min(r, vmcoreinfo_max_size - vmcoreinfo_size); |