diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/kexec.c | 5 | ||||
-rw-r--r-- | kernel/perf_event.c | 9 | ||||
-rw-r--r-- | kernel/time/ntp.c | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index ec19b92c7ebd..4e240a378df6 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -1099,7 +1099,8 @@ size_t crash_get_memory_size(void) | |||
1099 | return size; | 1099 | return size; |
1100 | } | 1100 | } |
1101 | 1101 | ||
1102 | static void free_reserved_phys_range(unsigned long begin, unsigned long end) | 1102 | void __weak crash_free_reserved_phys_range(unsigned long begin, |
1103 | unsigned long end) | ||
1103 | { | 1104 | { |
1104 | unsigned long addr; | 1105 | unsigned long addr; |
1105 | 1106 | ||
@@ -1135,7 +1136,7 @@ int crash_shrink_memory(unsigned long new_size) | |||
1135 | start = roundup(start, PAGE_SIZE); | 1136 | start = roundup(start, PAGE_SIZE); |
1136 | end = roundup(start + new_size, PAGE_SIZE); | 1137 | end = roundup(start + new_size, PAGE_SIZE); |
1137 | 1138 | ||
1138 | free_reserved_phys_range(end, crashk_res.end); | 1139 | crash_free_reserved_phys_range(end, crashk_res.end); |
1139 | 1140 | ||
1140 | if ((start == end) && (crashk_res.parent != NULL)) | 1141 | if ((start == end) && (crashk_res.parent != NULL)) |
1141 | release_resource(&crashk_res); | 1142 | release_resource(&crashk_res); |
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index c75925c4d1e2..27960f114efd 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -145,8 +145,8 @@ static struct srcu_struct pmus_srcu; | |||
145 | */ | 145 | */ |
146 | int sysctl_perf_event_paranoid __read_mostly = 1; | 146 | int sysctl_perf_event_paranoid __read_mostly = 1; |
147 | 147 | ||
148 | /* Minimum for 128 pages + 1 for the user control page */ | 148 | /* Minimum for 512 kiB + 1 user control page */ |
149 | int sysctl_perf_event_mlock __read_mostly = 516; /* 'free' kb per user */ | 149 | int sysctl_perf_event_mlock __read_mostly = 512 + (PAGE_SIZE / 1024); /* 'free' kiB per user */ |
150 | 150 | ||
151 | /* | 151 | /* |
152 | * max perf event sample rate | 152 | * max perf event sample rate |
@@ -6531,6 +6531,11 @@ SYSCALL_DEFINE5(perf_event_open, | |||
6531 | goto err_alloc; | 6531 | goto err_alloc; |
6532 | } | 6532 | } |
6533 | 6533 | ||
6534 | if (task) { | ||
6535 | put_task_struct(task); | ||
6536 | task = NULL; | ||
6537 | } | ||
6538 | |||
6534 | /* | 6539 | /* |
6535 | * Look up the group leader (we will attach this event to it): | 6540 | * Look up the group leader (we will attach this event to it): |
6536 | */ | 6541 | */ |
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 5f1bb8e2008f..f6117a4c7cb8 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -652,6 +652,8 @@ int do_adjtimex(struct timex *txc) | |||
652 | struct timespec delta; | 652 | struct timespec delta; |
653 | delta.tv_sec = txc->time.tv_sec; | 653 | delta.tv_sec = txc->time.tv_sec; |
654 | delta.tv_nsec = txc->time.tv_usec; | 654 | delta.tv_nsec = txc->time.tv_usec; |
655 | if (!capable(CAP_SYS_TIME)) | ||
656 | return -EPERM; | ||
655 | if (!(txc->modes & ADJ_NANO)) | 657 | if (!(txc->modes & ADJ_NANO)) |
656 | delta.tv_nsec *= 1000; | 658 | delta.tv_nsec *= 1000; |
657 | result = timekeeping_inject_offset(&delta); | 659 | result = timekeeping_inject_offset(&delta); |