linux: remove unused kernel patches
This commit is contained in:
parent
9f3f575ab3
commit
05b8cae9ec
@ -1,407 +0,0 @@
|
|||||||
commit e7cae741f6d645ac68fe8823ca6ef45dbbf6891b
|
|
||||||
Author: Tejun Heo <tj@kernel.org>
|
|
||||||
Date: Fri Mar 11 07:31:23 2016 -0500
|
|
||||||
|
|
||||||
sched: Misc preps for cgroup unified hierarchy interface
|
|
||||||
|
|
||||||
Make the following changes in preparation for the cpu controller
|
|
||||||
interface implementation for the unified hierarchy. This patch
|
|
||||||
doesn't cause any functional differences.
|
|
||||||
|
|
||||||
* s/cpu_stats_show()/cpu_cfs_stats_show()/
|
|
||||||
|
|
||||||
* s/cpu_files/cpu_legacy_files/
|
|
||||||
|
|
||||||
* Separate out cpuacct_stats_read() from cpuacct_stats_show(). While
|
|
||||||
at it, remove pointless cpuacct_stat_desc[] array.
|
|
||||||
|
|
||||||
Signed-off-by: Tejun Heo <tj@kernel.org>
|
|
||||||
Cc: Ingo Molnar <mingo@redhat.com>
|
|
||||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
|
||||||
Cc: Li Zefan <lizefan@huawei.com>
|
|
||||||
Cc: Johannes Weiner <hannes@cmpxchg.org>
|
|
||||||
|
|
||||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
|
||||||
index 732e993..77f3ddd 100644
|
|
||||||
--- a/kernel/sched/core.c
|
|
||||||
+++ b/kernel/sched/core.c
|
|
||||||
@@ -8512,7 +8512,7 @@ static int __cfs_schedulable(struct task_group *tg, u64 period, u64 quota)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static int cpu_stats_show(struct seq_file *sf, void *v)
|
|
||||||
+static int cpu_cfs_stats_show(struct seq_file *sf, void *v)
|
|
||||||
{
|
|
||||||
struct task_group *tg = css_tg(seq_css(sf));
|
|
||||||
struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
|
|
||||||
@@ -8552,7 +8552,7 @@ static u64 cpu_rt_period_read_uint(struct cgroup_subsys_state *css,
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_RT_GROUP_SCHED */
|
|
||||||
|
|
||||||
-static struct cftype cpu_files[] = {
|
|
||||||
+static struct cftype cpu_legacy_files[] = {
|
|
||||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
||||||
{
|
|
||||||
.name = "shares",
|
|
||||||
@@ -8573,7 +8573,7 @@ static struct cftype cpu_files[] = {
|
|
||||||
},
|
|
||||||
{
|
|
||||||
.name = "stat",
|
|
||||||
- .seq_show = cpu_stats_show,
|
|
||||||
+ .seq_show = cpu_cfs_stats_show,
|
|
||||||
},
|
|
||||||
#endif
|
|
||||||
#ifdef CONFIG_RT_GROUP_SCHED
|
|
||||||
@@ -8599,7 +8599,7 @@ struct cgroup_subsys cpu_cgrp_subsys = {
|
|
||||||
.fork = cpu_cgroup_fork,
|
|
||||||
.can_attach = cpu_cgroup_can_attach,
|
|
||||||
.attach = cpu_cgroup_attach,
|
|
||||||
- .legacy_cftypes = cpu_files,
|
|
||||||
+ .legacy_cftypes = cpu_legacy_files,
|
|
||||||
.early_init = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
|
|
||||||
index dd7cbb5..42b2dd5 100644
|
|
||||||
--- a/kernel/sched/cpuacct.c
|
|
||||||
+++ b/kernel/sched/cpuacct.c
|
|
||||||
@@ -177,36 +177,33 @@ static int cpuacct_percpu_seq_show(struct seq_file *m, void *V)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static const char * const cpuacct_stat_desc[] = {
|
|
||||||
- [CPUACCT_STAT_USER] = "user",
|
|
||||||
- [CPUACCT_STAT_SYSTEM] = "system",
|
|
||||||
-};
|
|
||||||
-
|
|
||||||
-static int cpuacct_stats_show(struct seq_file *sf, void *v)
|
|
||||||
+static void cpuacct_stats_read(struct cpuacct *ca, u64 *userp, u64 *sysp)
|
|
||||||
{
|
|
||||||
- struct cpuacct *ca = css_ca(seq_css(sf));
|
|
||||||
int cpu;
|
|
||||||
- s64 val = 0;
|
|
||||||
|
|
||||||
+ *userp = 0;
|
|
||||||
for_each_online_cpu(cpu) {
|
|
||||||
struct kernel_cpustat *kcpustat = per_cpu_ptr(ca->cpustat, cpu);
|
|
||||||
- val += kcpustat->cpustat[CPUTIME_USER];
|
|
||||||
- val += kcpustat->cpustat[CPUTIME_NICE];
|
|
||||||
+ *userp += kcpustat->cpustat[CPUTIME_USER];
|
|
||||||
+ *userp += kcpustat->cpustat[CPUTIME_NICE];
|
|
||||||
}
|
|
||||||
- val = cputime64_to_clock_t(val);
|
|
||||||
- seq_printf(sf, "%s %lld\n", cpuacct_stat_desc[CPUACCT_STAT_USER], val);
|
|
||||||
|
|
||||||
- val = 0;
|
|
||||||
+ *sysp = 0;
|
|
||||||
for_each_online_cpu(cpu) {
|
|
||||||
struct kernel_cpustat *kcpustat = per_cpu_ptr(ca->cpustat, cpu);
|
|
||||||
- val += kcpustat->cpustat[CPUTIME_SYSTEM];
|
|
||||||
- val += kcpustat->cpustat[CPUTIME_IRQ];
|
|
||||||
- val += kcpustat->cpustat[CPUTIME_SOFTIRQ];
|
|
||||||
+ *sysp += kcpustat->cpustat[CPUTIME_SYSTEM];
|
|
||||||
+ *sysp += kcpustat->cpustat[CPUTIME_IRQ];
|
|
||||||
+ *sysp += kcpustat->cpustat[CPUTIME_SOFTIRQ];
|
|
||||||
}
|
|
||||||
+}
|
|
||||||
|
|
||||||
- val = cputime64_to_clock_t(val);
|
|
||||||
- seq_printf(sf, "%s %lld\n", cpuacct_stat_desc[CPUACCT_STAT_SYSTEM], val);
|
|
||||||
+static int cpuacct_stats_show(struct seq_file *sf, void *v)
|
|
||||||
+{
|
|
||||||
+ cputime64_t user, sys;
|
|
||||||
|
|
||||||
+ cpuacct_stats_read(css_ca(seq_css(sf)), &user, &sys);
|
|
||||||
+ seq_printf(sf, "user %lld\n", cputime64_to_clock_t(user));
|
|
||||||
+ seq_printf(sf, "system %lld\n", cputime64_to_clock_t(sys));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
commit 1bb33e8a69f089f2d3f58a0e681d4ff352e11c97
|
|
||||||
Author: Tejun Heo <tj@kernel.org>
|
|
||||||
Date: Fri Mar 11 07:31:23 2016 -0500
|
|
||||||
|
|
||||||
sched: Implement interface for cgroup unified hierarchy
|
|
||||||
|
|
||||||
While the cpu controller doesn't have any functional problems, there
|
|
||||||
are a couple interface issues which can be addressed in the v2
|
|
||||||
interface.
|
|
||||||
|
|
||||||
* cpuacct being a separate controller. This separation is artificial
|
|
||||||
and rather pointless as demonstrated by most use cases co-mounting
|
|
||||||
the two controllers. It also forces certain information to be
|
|
||||||
accounted twice.
|
|
||||||
|
|
||||||
* Use of different time units. Writable control knobs use
|
|
||||||
microseconds, some stat fields use nanoseconds while other cpuacct
|
|
||||||
stat fields use centiseconds.
|
|
||||||
|
|
||||||
* Control knobs which can't be used in the root cgroup still show up
|
|
||||||
in the root.
|
|
||||||
|
|
||||||
* Control knob names and semantics aren't consistent with other
|
|
||||||
controllers.
|
|
||||||
|
|
||||||
This patchset implements cpu controller's interface on the unified
|
|
||||||
hierarchy which adheres to the controller file conventions described
|
|
||||||
in Documentation/cgroups/unified-hierarchy.txt. Overall, the
|
|
||||||
following changes are made.
|
|
||||||
|
|
||||||
* cpuacct is implictly enabled and disabled by cpu and its information
|
|
||||||
is reported through "cpu.stat" which now uses microseconds for all
|
|
||||||
time durations. All time duration fields now have "_usec" appended
|
|
||||||
to them for clarity. While this doesn't solve the double accounting
|
|
||||||
immediately, once majority of users switch to v2, cpu can directly
|
|
||||||
account and report the relevant stats and cpuacct can be disabled on
|
|
||||||
the unified hierarchy.
|
|
||||||
|
|
||||||
Note that cpuacct.usage_percpu is currently not included in
|
|
||||||
"cpu.stat". If this information is actually called for, it can be
|
|
||||||
added later.
|
|
||||||
|
|
||||||
* "cpu.shares" is replaced with "cpu.weight" and operates on the
|
|
||||||
standard scale defined by CGROUP_WEIGHT_MIN/DFL/MAX (1, 100, 10000).
|
|
||||||
The weight is scaled to scheduler weight so that 100 maps to 1024
|
|
||||||
and the ratio relationship is preserved - if weight is W and its
|
|
||||||
scaled value is S, W / 100 == S / 1024. While the mapped range is a
|
|
||||||
bit smaller than the orignal scheduler weight range, the dead zones
|
|
||||||
on both sides are relatively small and covers wider range than the
|
|
||||||
nice value mappings. This file doesn't make sense in the root
|
|
||||||
cgroup and isn't create on root.
|
|
||||||
|
|
||||||
* "cpu.cfs_quota_us" and "cpu.cfs_period_us" are replaced by "cpu.max"
|
|
||||||
which contains both quota and period.
|
|
||||||
|
|
||||||
* "cpu.rt_runtime_us" and "cpu.rt_period_us" are replaced by
|
|
||||||
"cpu.rt.max" which contains both runtime and period.
|
|
||||||
|
|
||||||
v2: cpu_stats_show() was incorrectly using CONFIG_FAIR_GROUP_SCHED for
|
|
||||||
CFS bandwidth stats and also using raw division for u64. Use
|
|
||||||
CONFIG_CFS_BANDWITH and do_div() instead.
|
|
||||||
|
|
||||||
The semantics of "cpu.rt.max" is not fully decided yet. Dropped
|
|
||||||
for now.
|
|
||||||
|
|
||||||
Signed-off-by: Tejun Heo <tj@kernel.org>
|
|
||||||
Cc: Ingo Molnar <mingo@redhat.com>
|
|
||||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
|
||||||
Cc: Li Zefan <lizefan@huawei.com>
|
|
||||||
Cc: Johannes Weiner <hannes@cmpxchg.org>
|
|
||||||
|
|
||||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
|
||||||
index 77f3ddd..7aafe63 100644
|
|
||||||
--- a/kernel/sched/core.c
|
|
||||||
+++ b/kernel/sched/core.c
|
|
||||||
@@ -8591,6 +8591,139 @@ static struct cftype cpu_legacy_files[] = {
|
|
||||||
{ } /* terminate */
|
|
||||||
};
|
|
||||||
|
|
||||||
+static int cpu_stats_show(struct seq_file *sf, void *v)
|
|
||||||
+{
|
|
||||||
+ cpuacct_cpu_stats_show(sf);
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_CFS_BANDWIDTH
|
|
||||||
+ {
|
|
||||||
+ struct task_group *tg = css_tg(seq_css(sf));
|
|
||||||
+ struct cfs_bandwidth *cfs_b = &tg->cfs_bandwidth;
|
|
||||||
+ u64 throttled_usec;
|
|
||||||
+
|
|
||||||
+ throttled_usec = cfs_b->throttled_time;
|
|
||||||
+ do_div(throttled_usec, NSEC_PER_USEC);
|
|
||||||
+
|
|
||||||
+ seq_printf(sf, "nr_periods %d\n"
|
|
||||||
+ "nr_throttled %d\n"
|
|
||||||
+ "throttled_usec %llu\n",
|
|
||||||
+ cfs_b->nr_periods, cfs_b->nr_throttled,
|
|
||||||
+ throttled_usec);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
||||||
+static u64 cpu_weight_read_u64(struct cgroup_subsys_state *css,
|
|
||||||
+ struct cftype *cft)
|
|
||||||
+{
|
|
||||||
+ struct task_group *tg = css_tg(css);
|
|
||||||
+ u64 weight = scale_load_down(tg->shares);
|
|
||||||
+
|
|
||||||
+ return DIV_ROUND_CLOSEST_ULL(weight * CGROUP_WEIGHT_DFL, 1024);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static int cpu_weight_write_u64(struct cgroup_subsys_state *css,
|
|
||||||
+ struct cftype *cftype, u64 weight)
|
|
||||||
+{
|
|
||||||
+ /*
|
|
||||||
+ * cgroup weight knobs should use the common MIN, DFL and MAX
|
|
||||||
+ * values which are 1, 100 and 10000 respectively. While it loses
|
|
||||||
+ * a bit of range on both ends, it maps pretty well onto the shares
|
|
||||||
+ * value used by scheduler and the round-trip conversions preserve
|
|
||||||
+ * the original value over the entire range.
|
|
||||||
+ */
|
|
||||||
+ if (weight < CGROUP_WEIGHT_MIN || weight > CGROUP_WEIGHT_MAX)
|
|
||||||
+ return -ERANGE;
|
|
||||||
+
|
|
||||||
+ weight = DIV_ROUND_CLOSEST_ULL(weight * 1024, CGROUP_WEIGHT_DFL);
|
|
||||||
+
|
|
||||||
+ return sched_group_set_shares(css_tg(css), scale_load(weight));
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+static void __maybe_unused cpu_period_quota_print(struct seq_file *sf,
|
|
||||||
+ long period, long quota)
|
|
||||||
+{
|
|
||||||
+ if (quota < 0)
|
|
||||||
+ seq_puts(sf, "max");
|
|
||||||
+ else
|
|
||||||
+ seq_printf(sf, "%ld", quota);
|
|
||||||
+
|
|
||||||
+ seq_printf(sf, " %ld\n", period);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/* caller should put the current value in *@periodp before calling */
|
|
||||||
+static int __maybe_unused cpu_period_quota_parse(char *buf,
|
|
||||||
+ u64 *periodp, u64 *quotap)
|
|
||||||
+{
|
|
||||||
+ char tok[21]; /* U64_MAX */
|
|
||||||
+
|
|
||||||
+ if (!sscanf(buf, "%s %llu", tok, periodp))
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ *periodp *= NSEC_PER_USEC;
|
|
||||||
+
|
|
||||||
+ if (sscanf(tok, "%llu", quotap))
|
|
||||||
+ *quotap *= NSEC_PER_USEC;
|
|
||||||
+ else if (!strcmp(tok, "max"))
|
|
||||||
+ *quotap = RUNTIME_INF;
|
|
||||||
+ else
|
|
||||||
+ return -EINVAL;
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+#ifdef CONFIG_CFS_BANDWIDTH
|
|
||||||
+static int cpu_max_show(struct seq_file *sf, void *v)
|
|
||||||
+{
|
|
||||||
+ struct task_group *tg = css_tg(seq_css(sf));
|
|
||||||
+
|
|
||||||
+ cpu_period_quota_print(sf, tg_get_cfs_period(tg), tg_get_cfs_quota(tg));
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static ssize_t cpu_max_write(struct kernfs_open_file *of,
|
|
||||||
+ char *buf, size_t nbytes, loff_t off)
|
|
||||||
+{
|
|
||||||
+ struct task_group *tg = css_tg(of_css(of));
|
|
||||||
+ u64 period = tg_get_cfs_period(tg);
|
|
||||||
+ u64 quota;
|
|
||||||
+ int ret;
|
|
||||||
+
|
|
||||||
+ ret = cpu_period_quota_parse(buf, &period, "a);
|
|
||||||
+ if (!ret)
|
|
||||||
+ ret = tg_set_cfs_bandwidth(tg, period, quota);
|
|
||||||
+ return ret ?: nbytes;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+static struct cftype cpu_files[] = {
|
|
||||||
+ {
|
|
||||||
+ .name = "stat",
|
|
||||||
+ .flags = CFTYPE_NOT_ON_ROOT,
|
|
||||||
+ .seq_show = cpu_stats_show,
|
|
||||||
+ },
|
|
||||||
+#ifdef CONFIG_FAIR_GROUP_SCHED
|
|
||||||
+ {
|
|
||||||
+ .name = "weight",
|
|
||||||
+ .flags = CFTYPE_NOT_ON_ROOT,
|
|
||||||
+ .read_u64 = cpu_weight_read_u64,
|
|
||||||
+ .write_u64 = cpu_weight_write_u64,
|
|
||||||
+ },
|
|
||||||
+#endif
|
|
||||||
+#ifdef CONFIG_CFS_BANDWIDTH
|
|
||||||
+ {
|
|
||||||
+ .name = "max",
|
|
||||||
+ .flags = CFTYPE_NOT_ON_ROOT,
|
|
||||||
+ .seq_show = cpu_max_show,
|
|
||||||
+ .write = cpu_max_write,
|
|
||||||
+ },
|
|
||||||
+#endif
|
|
||||||
+ { } /* terminate */
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
struct cgroup_subsys cpu_cgrp_subsys = {
|
|
||||||
.css_alloc = cpu_cgroup_css_alloc,
|
|
||||||
.css_free = cpu_cgroup_css_free,
|
|
||||||
@@ -8600,7 +8733,15 @@ struct cgroup_subsys cpu_cgrp_subsys = {
|
|
||||||
.can_attach = cpu_cgroup_can_attach,
|
|
||||||
.attach = cpu_cgroup_attach,
|
|
||||||
.legacy_cftypes = cpu_legacy_files,
|
|
||||||
+ .dfl_cftypes = cpu_files,
|
|
||||||
.early_init = 1,
|
|
||||||
+#ifdef CONFIG_CGROUP_CPUACCT
|
|
||||||
+ /*
|
|
||||||
+ * cpuacct is enabled together with cpu on the unified hierarchy
|
|
||||||
+ * and its stats are reported through "cpu.stat".
|
|
||||||
+ */
|
|
||||||
+ .depends_on = 1 << cpuacct_cgrp_id,
|
|
||||||
+#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* CONFIG_CGROUP_SCHED */
|
|
||||||
diff --git a/kernel/sched/cpuacct.c b/kernel/sched/cpuacct.c
|
|
||||||
index 42b2dd5..b4d32a6 100644
|
|
||||||
--- a/kernel/sched/cpuacct.c
|
|
||||||
+++ b/kernel/sched/cpuacct.c
|
|
||||||
@@ -224,6 +224,30 @@ static struct cftype files[] = {
|
|
||||||
{ } /* terminate */
|
|
||||||
};
|
|
||||||
|
|
||||||
+/* used to print cpuacct stats in cpu.stat on the unified hierarchy */
|
|
||||||
+void cpuacct_cpu_stats_show(struct seq_file *sf)
|
|
||||||
+{
|
|
||||||
+ struct cgroup_subsys_state *css;
|
|
||||||
+ u64 usage, user, sys;
|
|
||||||
+
|
|
||||||
+ css = cgroup_get_e_css(seq_css(sf)->cgroup, &cpuacct_cgrp_subsys);
|
|
||||||
+
|
|
||||||
+ usage = cpuusage_read(css, seq_cft(sf));
|
|
||||||
+ cpuacct_stats_read(css_ca(css), &user, &sys);
|
|
||||||
+
|
|
||||||
+ user *= TICK_NSEC;
|
|
||||||
+ sys *= TICK_NSEC;
|
|
||||||
+ do_div(usage, NSEC_PER_USEC);
|
|
||||||
+ do_div(user, NSEC_PER_USEC);
|
|
||||||
+ do_div(sys, NSEC_PER_USEC);
|
|
||||||
+
|
|
||||||
+ seq_printf(sf, "usage_usec %llu\n"
|
|
||||||
+ "user_usec %llu\n"
|
|
||||||
+ "system_usec %llu\n", usage, user, sys);
|
|
||||||
+
|
|
||||||
+ css_put(css);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* charge this task's execution time to its accounting group.
|
|
||||||
*
|
|
||||||
diff --git a/kernel/sched/cpuacct.h b/kernel/sched/cpuacct.h
|
|
||||||
index ed60562..44eace9 100644
|
|
||||||
--- a/kernel/sched/cpuacct.h
|
|
||||||
+++ b/kernel/sched/cpuacct.h
|
|
||||||
@@ -2,6 +2,7 @@
|
|
||||||
|
|
||||||
extern void cpuacct_charge(struct task_struct *tsk, u64 cputime);
|
|
||||||
extern void cpuacct_account_field(struct task_struct *p, int index, u64 val);
|
|
||||||
+extern void cpuacct_cpu_stats_show(struct seq_file *sf);
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
@@ -14,4 +15,8 @@ cpuacct_account_field(struct task_struct *p, int index, u64 val)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
+static inline void cpuacct_cpu_stats_show(struct seq_file *sf)
|
|
||||||
+{
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||||||
See https://github.com/NixOS/nixpkgs/issues/6231
|
|
||||||
|
|
||||||
v3.14.31:crypto/crc32c.c is missing the MODULE_ALIAS_CRYPTO("crc32c").
|
|
||||||
That's probably because crypto/crc32c.c was renamed to
|
|
||||||
crypto/crc32c_generic.c in commit
|
|
||||||
06e5a1f29819759392239669beb2cad27059c8ec and therefore fell through
|
|
||||||
the cracks when backporting commit
|
|
||||||
5d26a105b5a73e5635eae0629b42fa0a90e07b7b.
|
|
||||||
|
|
||||||
So the affected kernels (all that backported the "crypto-" prefix
|
|
||||||
patches) need this additional patch:
|
|
||||||
|
|
||||||
diff --git a/crypto/crc32c.c b/crypto/crc32c.c
|
|
||||||
index 06f7018c9d95..aae5829eb681 100644
|
|
||||||
--- a/crypto/crc32c.c
|
|
||||||
+++ b/crypto/crc32c.c
|
|
||||||
@@ -167,6 +167,7 @@ static void __exit crc32c_mod_fini(void)
|
|
||||||
module_init(crc32c_mod_init);
|
|
||||||
module_exit(crc32c_mod_fini);
|
|
||||||
|
|
||||||
+MODULE_ALIAS_CRYPTO("crc32c");
|
|
||||||
MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>");
|
|
||||||
MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c");
|
|
||||||
MODULE_LICENSE("GPL");
|
|
@ -1,45 +0,0 @@
|
|||||||
|
|
||||||
From Yang Shi <>
|
|
||||||
Subject [PATCH] crypto: rsa - fix a potential race condition in build
|
|
||||||
Date Fri, 2 Dec 2016 15:41:04 -0800
|
|
||||||
|
|
||||||
|
|
||||||
When building kernel with RSA enabled with multithreaded, the below
|
|
||||||
compile failure might be caught:
|
|
||||||
|
|
||||||
| /buildarea/kernel-source/crypto/rsa_helper.c:18:28: fatal error: rsapubkey-asn1.h: No such file or directory
|
|
||||||
| #include "rsapubkey-asn1.h"
|
|
||||||
| ^
|
|
||||||
| compilation terminated.
|
|
||||||
| CC crypto/rsa-pkcs1pad.o
|
|
||||||
| CC crypto/algboss.o
|
|
||||||
| CC crypto/testmgr.o
|
|
||||||
| make[3]: *** [/buildarea/kernel-source/scripts/Makefile.build:289: crypto/rsa_helper.o] Error 1
|
|
||||||
| make[3]: *** Waiting for unfinished jobs....
|
|
||||||
| make[2]: *** [/buildarea/kernel-source/Makefile:969: crypto] Error 2
|
|
||||||
| make[1]: *** [Makefile:150: sub-make] Error 2
|
|
||||||
| make: *** [Makefile:24: __sub-make] Error 2
|
|
||||||
|
|
||||||
The header file is not generated before rsa_helper is compiled, so
|
|
||||||
adding dependency to avoid such issue.
|
|
||||||
|
|
||||||
Signed-off-by: Yang Shi <yang.shi@windriver.com>
|
|
||||||
|
|
||||||
---
|
|
||||||
crypto/Makefile | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/crypto/Makefile b/crypto/Makefile
|
|
||||||
index 99cc64a..8db39f9 100644
|
|
||||||
--- a/crypto/Makefile
|
|
||||||
+++ b/crypto/Makefile
|
|
||||||
@@ -40,6 +40,7 @@ obj-$(CONFIG_CRYPTO_ECDH) += ecdh_generic.o
|
|
||||||
|
|
||||||
$(obj)/rsapubkey-asn1.o: $(obj)/rsapubkey-asn1.c $(obj)/rsapubkey-asn1.h
|
|
||||||
$(obj)/rsaprivkey-asn1.o: $(obj)/rsaprivkey-asn1.c $(obj)/rsaprivkey-asn1.h
|
|
||||||
+$(obj)/rsa_helper.o: $(obj)/rsa_helper.c $(obj)/rsaprivkey-asn1.h
|
|
||||||
clean-files += rsapubkey-asn1.c rsapubkey-asn1.h
|
|
||||||
clean-files += rsaprivkey-asn1.c rsaprivkey-asn1.h
|
|
||||||
|
|
||||||
--
|
|
||||||
2.0.2
|
|
@ -1,85 +0,0 @@
|
|||||||
--- a/arch/x86/xen/enlighten.c
|
|
||||||
+++ b/arch/x86/xen/enlighten.c
|
|
||||||
@@ -168,21 +168,23 @@ static void __init xen_banner(void)
|
|
||||||
xen_feature(XENFEAT_mmu_pt_update_preserve_ad) ? " (preserve-AD)" : "");
|
|
||||||
}
|
|
||||||
|
|
||||||
+static __read_mostly unsigned int cpuid_leaf1_edx_mask = ~0;
|
|
||||||
+static __read_mostly unsigned int cpuid_leaf1_ecx_mask = ~0;
|
|
||||||
+
|
|
||||||
static void xen_cpuid(unsigned int *ax, unsigned int *bx,
|
|
||||||
unsigned int *cx, unsigned int *dx)
|
|
||||||
{
|
|
||||||
+ unsigned maskecx = ~0;
|
|
||||||
unsigned maskedx = ~0;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Mask out inconvenient features, to try and disable as many
|
|
||||||
* unsupported kernel subsystems as possible.
|
|
||||||
*/
|
|
||||||
- if (*ax == 1)
|
|
||||||
- maskedx = ~((1 << X86_FEATURE_APIC) | /* disable APIC */
|
|
||||||
- (1 << X86_FEATURE_ACPI) | /* disable ACPI */
|
|
||||||
- (1 << X86_FEATURE_MCE) | /* disable MCE */
|
|
||||||
- (1 << X86_FEATURE_MCA) | /* disable MCA */
|
|
||||||
- (1 << X86_FEATURE_ACC)); /* thermal monitoring */
|
|
||||||
+ if (*ax == 1) {
|
|
||||||
+ maskecx = cpuid_leaf1_ecx_mask;
|
|
||||||
+ maskedx = cpuid_leaf1_edx_mask;
|
|
||||||
+ }
|
|
||||||
|
|
||||||
asm(XEN_EMULATE_PREFIX "cpuid"
|
|
||||||
: "=a" (*ax),
|
|
||||||
@@ -190,9 +192,43 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
|
|
||||||
"=c" (*cx),
|
|
||||||
"=d" (*dx)
|
|
||||||
: "0" (*ax), "2" (*cx));
|
|
||||||
+
|
|
||||||
+ *cx &= maskecx;
|
|
||||||
*dx &= maskedx;
|
|
||||||
}
|
|
||||||
|
|
||||||
+static __init void xen_init_cpuid_mask(void)
|
|
||||||
+{
|
|
||||||
+ unsigned int ax, bx, cx, dx;
|
|
||||||
+
|
|
||||||
+ cpuid_leaf1_edx_mask =
|
|
||||||
+ ~((1 << X86_FEATURE_MCE) | /* disable MCE */
|
|
||||||
+ (1 << X86_FEATURE_MCA) | /* disable MCA */
|
|
||||||
+ (1 << X86_FEATURE_ACC)); /* thermal monitoring */
|
|
||||||
+
|
|
||||||
+ if (!xen_initial_domain())
|
|
||||||
+ cpuid_leaf1_edx_mask &=
|
|
||||||
+ ~((1 << X86_FEATURE_APIC) | /* disable local APIC */
|
|
||||||
+ (1 << X86_FEATURE_ACPI)); /* disable ACPI */
|
|
||||||
+
|
|
||||||
+ ax = 1;
|
|
||||||
+ xen_cpuid(&ax, &bx, &cx, &dx);
|
|
||||||
+
|
|
||||||
+ /* cpuid claims we support xsave; try enabling it to see what happens */
|
|
||||||
+ if (cx & (1 << (X86_FEATURE_XSAVE % 32))) {
|
|
||||||
+ unsigned long cr4;
|
|
||||||
+
|
|
||||||
+ set_in_cr4(X86_CR4_OSXSAVE);
|
|
||||||
+
|
|
||||||
+ cr4 = read_cr4();
|
|
||||||
+
|
|
||||||
+ if ((cr4 & X86_CR4_OSXSAVE) == 0)
|
|
||||||
+ cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_XSAVE % 32));
|
|
||||||
+
|
|
||||||
+ clear_in_cr4(X86_CR4_OSXSAVE);
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static void xen_set_debugreg(int reg, unsigned long val)
|
|
||||||
{
|
|
||||||
HYPERVISOR_set_debugreg(reg, val);
|
|
||||||
@@ -903,6 +939,8 @@ asmlinkage void __init xen_start_kernel(void)
|
|
||||||
|
|
||||||
xen_init_irq_ops();
|
|
||||||
|
|
||||||
+ xen_init_cpuid_mask();
|
|
||||||
+
|
|
||||||
#ifdef CONFIG_X86_LOCAL_APIC
|
|
||||||
/*
|
|
||||||
* set up the basic apic ops.
|
|
@ -21,12 +21,6 @@ in
|
|||||||
|
|
||||||
rec {
|
rec {
|
||||||
|
|
||||||
multithreaded_rsapubkey =
|
|
||||||
{
|
|
||||||
name = "multithreaded-rsapubkey-asn1.patch";
|
|
||||||
patch = ./multithreaded-rsapubkey-asn1.patch;
|
|
||||||
};
|
|
||||||
|
|
||||||
bridge_stp_helper =
|
bridge_stp_helper =
|
||||||
{ name = "bridge-stp-helper";
|
{ name = "bridge-stp-helper";
|
||||||
patch = ./bridge-stp-helper.patch;
|
patch = ./bridge-stp-helper.patch;
|
||||||
@ -37,12 +31,6 @@ rec {
|
|||||||
patch = ./p9-fixes.patch;
|
patch = ./p9-fixes.patch;
|
||||||
};
|
};
|
||||||
|
|
||||||
no_xsave =
|
|
||||||
{ name = "no-xsave";
|
|
||||||
patch = ./no-xsave.patch;
|
|
||||||
features.noXsave = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
mips_fpureg_emu =
|
mips_fpureg_emu =
|
||||||
{ name = "mips-fpureg-emulation";
|
{ name = "mips-fpureg-emulation";
|
||||||
patch = ./mips-fpureg-emulation.patch;
|
patch = ./mips-fpureg-emulation.patch;
|
||||||
@ -63,22 +51,6 @@ rec {
|
|||||||
patch = ./modinst-arg-list-too-long.patch;
|
patch = ./modinst-arg-list-too-long.patch;
|
||||||
};
|
};
|
||||||
|
|
||||||
ubuntu_fan_4_4 =
|
|
||||||
{ name = "ubuntu-fan";
|
|
||||||
patch = ./ubuntu-fan-4.4.patch;
|
|
||||||
};
|
|
||||||
|
|
||||||
ubuntu_unprivileged_overlayfs =
|
|
||||||
{ name = "ubuntu-unprivileged-overlayfs";
|
|
||||||
patch = ./ubuntu-unprivileged-overlayfs.patch;
|
|
||||||
};
|
|
||||||
|
|
||||||
tuxonice_3_10 = makeTuxonicePatch {
|
|
||||||
version = "2013-11-07";
|
|
||||||
kernelVersion = "3.10.18";
|
|
||||||
sha256 = "00b1rqgd4yr206dxp4mcymr56ymbjcjfa4m82pxw73khj032qw3j";
|
|
||||||
};
|
|
||||||
|
|
||||||
grsecurity_testing = throw ''
|
grsecurity_testing = throw ''
|
||||||
Upstream has ceased free support for grsecurity/PaX.
|
Upstream has ceased free support for grsecurity/PaX.
|
||||||
|
|
||||||
@ -87,11 +59,6 @@ rec {
|
|||||||
for more information.
|
for more information.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
crc_regression =
|
|
||||||
{ name = "crc-backport-regression";
|
|
||||||
patch = ./crc-regression.patch;
|
|
||||||
};
|
|
||||||
|
|
||||||
genksyms_fix_segfault =
|
genksyms_fix_segfault =
|
||||||
{ name = "genksyms-fix-segfault";
|
{ name = "genksyms-fix-segfault";
|
||||||
patch = ./genksyms-fix-segfault.patch;
|
patch = ./genksyms-fix-segfault.patch;
|
||||||
@ -107,47 +74,8 @@ rec {
|
|||||||
patch = ./chromiumos-patches/no-link-restrictions.patch;
|
patch = ./chromiumos-patches/no-link-restrictions.patch;
|
||||||
};
|
};
|
||||||
|
|
||||||
chromiumos_mfd_fix_dependency =
|
|
||||||
{ name = "mfd_fix_dependency";
|
|
||||||
patch = ./chromiumos-patches/mfd-fix-dependency.patch;
|
|
||||||
};
|
|
||||||
|
|
||||||
hiddev_CVE_2016_5829 =
|
|
||||||
{ name = "hiddev_CVE_2016_5829";
|
|
||||||
patch = fetchpatch {
|
|
||||||
url = "https://sources.debian.net/data/main/l/linux/4.6.3-1/debian/patches/bugfix/all/HID-hiddev-validate-num_values-for-HIDIOCGUSAGES-HID.patch";
|
|
||||||
sha256 = "14rm1qr87p7a5prz8g5fwbpxzdp3ighj095x8rvhm8csm20wspyy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
cpu-cgroup-v2 = import ./cpu-cgroup-v2-patches;
|
cpu-cgroup-v2 = import ./cpu-cgroup-v2-patches;
|
||||||
|
|
||||||
lguest_entry-linkage =
|
|
||||||
{ name = "lguest-asmlinkage.patch";
|
|
||||||
patch = fetchpatch {
|
|
||||||
url = "https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git"
|
|
||||||
+ "/patch/drivers/lguest/x86/core.c?id=cdd77e87eae52";
|
|
||||||
sha256 = "04xlx6al10cw039av6jkby7gx64zayj8m1k9iza40sw0fydcfqhc";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
packet_fix_race_condition_CVE_2016_8655 =
|
|
||||||
{ name = "packet_fix_race_condition_CVE_2016_8655.patch";
|
|
||||||
patch = fetchpatch {
|
|
||||||
url = "https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=84ac7260236a49c79eede91617700174c2c19b0c";
|
|
||||||
sha256 = "19viqjjgq8j8jiz5yhgmzwhqvhwv175q645qdazd1k69d25nv2ki";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
panic_on_icmp6_frag_CVE_2016_9919 = rec
|
|
||||||
{ name = "panic_on_icmp6_frag_CVE_2016_9919.patch";
|
|
||||||
patch = fetchpatch {
|
|
||||||
inherit name;
|
|
||||||
url = "https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=79dc7e3f1cd323be4c81aa1a94faa1b3ed987fb2";
|
|
||||||
sha256 = "0mps33r4mnwiy0bmgrzgqkrk59yya17v6kzpv9024g4xlz61rk8p";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
DCCP_double_free_vulnerability_CVE-2017-6074 = rec
|
DCCP_double_free_vulnerability_CVE-2017-6074 = rec
|
||||||
{ name = "DCCP_double_free_vulnerability_CVE-2017-6074.patch";
|
{ name = "DCCP_double_free_vulnerability_CVE-2017-6074.patch";
|
||||||
patch = fetchpatch {
|
patch = fetchpatch {
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
--- perf/config/utilities.mak.orig 2014-01-25 14:55:32.573320370 +0000
|
|
||||||
+++ perf/config/utilities.mak 2014-01-25 15:13:34.174337760 +0000
|
|
||||||
@@ -186,9 +186,14 @@
|
|
||||||
endif
|
|
||||||
TRY_CC_MSG=echo " CHK $(3)" 1>&2;
|
|
||||||
|
|
||||||
+define newline
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+endef
|
|
||||||
+
|
|
||||||
try-cc = $(shell sh -c \
|
|
||||||
'TMP="$(OUTPUT)$(TMPOUT).$$$$"; \
|
|
||||||
$(TRY_CC_MSG) \
|
|
||||||
- echo "$(1)" | \
|
|
||||||
+ echo -e "$(subst $(newline),\\n,$(1))" | tee _test.c | \
|
|
||||||
$(CC) -x c - $(2) -o "$$TMP" $(TRY_CC_OUTPUT) && echo y; \
|
|
||||||
rm -f "$$TMP"')
|
|
@ -16,7 +16,6 @@ stdenv.mkDerivation {
|
|||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cd tools/perf
|
cd tools/perf
|
||||||
sed -i s,/usr/include/elfutils,$elfutils/include/elfutils, Makefile
|
sed -i s,/usr/include/elfutils,$elfutils/include/elfutils, Makefile
|
||||||
${optionalString (versionOlder kernel.version "3.13") "patch -p1 < ${./perf.diff}"}
|
|
||||||
[ -f bash_completion ] && sed -i 's,^have perf,_have perf,' bash_completion
|
[ -f bash_completion ] && sed -i 's,^have perf,_have perf,' bash_completion
|
||||||
export makeFlags="DESTDIR=$out $makeFlags"
|
export makeFlags="DESTDIR=$out $makeFlags"
|
||||||
'';
|
'';
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,69 +0,0 @@
|
|||||||
From 7415cb7b31569e9266229d4ebc79ccec4841ab04 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Serge Hallyn <serge.hallyn@ubuntu.com>
|
|
||||||
Date: Fri, 7 Feb 2014 09:32:46 -0600
|
|
||||||
Subject: [PATCH] UBUNTU: SAUCE: Overlayfs: allow unprivileged mounts
|
|
||||||
|
|
||||||
Unprivileged mounting, here, refers to root in a non-initial user
|
|
||||||
namespace performing the mount. In particular, it requires
|
|
||||||
CAP_SYS_ADMIN toward the task's mounts namespace, alleviating
|
|
||||||
the concerns of manipulating mount environment for setuid-root
|
|
||||||
binaries on the host.
|
|
||||||
|
|
||||||
We refuse unprivileged mounting of most filesystem types because
|
|
||||||
we do not trust the in-kernel superblock parsers to correctly
|
|
||||||
handle malicious input.
|
|
||||||
|
|
||||||
However, overlayfs does not parse any user-provided data other
|
|
||||||
than the pathnames passed in. Therefore unprivileged mounting
|
|
||||||
of overlayfs should be safe.
|
|
||||||
|
|
||||||
Allowing unprivileged mounting of overlayfs filesystems would
|
|
||||||
allow Ubuntu Trusty users to create overlayfs-based container
|
|
||||||
snapshots, which would be a huge usability improvement.
|
|
||||||
|
|
||||||
This patch enables unprivileged mounting of overlayfs.
|
|
||||||
|
|
||||||
I tested a few simple combinations, and found that, when
|
|
||||||
doing (the equivalent of)
|
|
||||||
|
|
||||||
mount -t overlayfs -oupperdir=u,lowerdir=l l t
|
|
||||||
|
|
||||||
(u for upper, l for lower, t for target),
|
|
||||||
|
|
||||||
1. overlayfs mount is always allowed, regardless of ownership
|
|
||||||
of u, l, or t. However
|
|
||||||
|
|
||||||
2. Creation of new files is allowed so long as u is owned by
|
|
||||||
T. Otherwise, regardless of ownerships of l and t it is
|
|
||||||
denied. (This is expected; t was the mountpoint and
|
|
||||||
'disapears', so its ownership is irrelevant)
|
|
||||||
|
|
||||||
3. modification of a file 'hithere' which is in l but not yet
|
|
||||||
in u, and which is not owned by T, is not allowed, even if
|
|
||||||
writes to u are allowed. This may be a bug in overlayfs,
|
|
||||||
but it is safe behavior. It also will not cause a problem
|
|
||||||
for lxc since lxc will ensure that files are mapped into T's
|
|
||||||
namespace.
|
|
||||||
|
|
||||||
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
|
|
||||||
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
|
|
||||||
Signed-off-by: Andy Whitcroft <apw@canonical.com>
|
|
||||||
---
|
|
||||||
fs/overlayfs/super.c | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
|
|
||||||
index 9473e79..50890c2 100644
|
|
||||||
--- a/fs/overlayfs/super.c
|
|
||||||
+++ b/fs/overlayfs/super.c
|
|
||||||
@@ -668,6 +668,7 @@ static struct file_system_type ovl_fs_type = {
|
|
||||||
.name = "overlayfs",
|
|
||||||
.mount = ovl_mount,
|
|
||||||
.kill_sb = kill_anon_super,
|
|
||||||
+ .fs_flags = FS_USERNS_MOUNT,
|
|
||||||
};
|
|
||||||
MODULE_ALIAS_FS("overlayfs");
|
|
||||||
|
|
||||||
--
|
|
||||||
2.1.0.rc1
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user