diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 7 | ||||
-rw-r--r-- | kernel/perf_counter.c | 3 |
2 files changed, 7 insertions, 3 deletions
diff --git a/kernel/module.c b/kernel/module.c index eccb561dd8a3..2d537186191f 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -1274,6 +1274,10 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect, | |||
1274 | struct module_notes_attrs *notes_attrs; | 1274 | struct module_notes_attrs *notes_attrs; |
1275 | struct bin_attribute *nattr; | 1275 | struct bin_attribute *nattr; |
1276 | 1276 | ||
1277 | /* failed to create section attributes, so can't create notes */ | ||
1278 | if (!mod->sect_attrs) | ||
1279 | return; | ||
1280 | |||
1277 | /* Count notes sections and allocate structures. */ | 1281 | /* Count notes sections and allocate structures. */ |
1278 | notes = 0; | 1282 | notes = 0; |
1279 | for (i = 0; i < nsect; i++) | 1283 | for (i = 0; i < nsect; i++) |
@@ -2355,8 +2359,7 @@ static noinline struct module *load_module(void __user *umod, | |||
2355 | if (err < 0) | 2359 | if (err < 0) |
2356 | goto unlink; | 2360 | goto unlink; |
2357 | add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs); | 2361 | add_sect_attrs(mod, hdr->e_shnum, secstrings, sechdrs); |
2358 | if (mod->sect_attrs) | 2362 | add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs); |
2359 | add_notes_attrs(mod, hdr->e_shnum, secstrings, sechdrs); | ||
2360 | 2363 | ||
2361 | /* Get rid of temporary copy */ | 2364 | /* Get rid of temporary copy */ |
2362 | vfree(hdr); | 2365 | vfree(hdr); |
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index f274e1959885..d7cbc579fc80 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -50,7 +50,7 @@ static atomic_t nr_task_counters __read_mostly; | |||
50 | * 1 - disallow cpu counters to unpriv | 50 | * 1 - disallow cpu counters to unpriv |
51 | * 2 - disallow kernel profiling to unpriv | 51 | * 2 - disallow kernel profiling to unpriv |
52 | */ | 52 | */ |
53 | int sysctl_perf_counter_paranoid __read_mostly; | 53 | int sysctl_perf_counter_paranoid __read_mostly = 1; |
54 | 54 | ||
55 | static inline bool perf_paranoid_cpu(void) | 55 | static inline bool perf_paranoid_cpu(void) |
56 | { | 56 | { |
@@ -4066,6 +4066,7 @@ perf_counter_alloc(struct perf_counter_attr *attr, | |||
4066 | hwc->sample_period = attr->sample_period; | 4066 | hwc->sample_period = attr->sample_period; |
4067 | if (attr->freq && attr->sample_freq) | 4067 | if (attr->freq && attr->sample_freq) |
4068 | hwc->sample_period = 1; | 4068 | hwc->sample_period = 1; |
4069 | hwc->last_period = hwc->sample_period; | ||
4069 | 4070 | ||
4070 | atomic64_set(&hwc->period_left, hwc->sample_period); | 4071 | atomic64_set(&hwc->period_left, hwc->sample_period); |
4071 | 4072 | ||