From: Alex Shi Date: Tue, 11 Oct 2016 21:33:37 +0000 (+0200) Subject: Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android X-Git-Tag: firefly_0821_release~176^2~177 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=16d185eee470cf2dc3e909a59132893abfdd4b11;p=firefly-linux-kernel-4.4.55.git Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android Conflicts: kernel/cpuset.c --- 16d185eee470cf2dc3e909a59132893abfdd4b11 diff --cc kernel/cpuset.c index e2e294d997e0,b9279a2844d8..e5bd044c1cbb --- a/kernel/cpuset.c +++ b/kernel/cpuset.c @@@ -2084,23 -2074,20 +2084,37 @@@ static void cpuset_bind(struct cgroup_s mutex_unlock(&cpuset_mutex); } +static int cpuset_allow_attach(struct cgroup_taskset *tset) +{ + const struct cred *cred = current_cred(), *tcred; + struct task_struct *task; + struct cgroup_subsys_state *css; + + cgroup_taskset_for_each(task, css, tset) { + tcred = __task_cred(task); + + if ((current != task) && !capable(CAP_SYS_ADMIN) && + cred->euid.val != tcred->uid.val && cred->euid.val != tcred->suid.val) + return -EACCES; + } + + return 0; +} + + /* + * Make sure the new task conform to the current state of its parent, + * which could have been changed by cpuset just after it inherits the + * state from the parent and before it sits on the cgroup's task list. + */ + void cpuset_fork(struct task_struct *task, void *priv) + { + if (task_css_is_root(task, cpuset_cgrp_id)) + return; + + set_cpus_allowed_ptr(task, ¤t->cpus_allowed); + task->mems_allowed = current->mems_allowed; + } + struct cgroup_subsys cpuset_cgrp_subsys = { .css_alloc = cpuset_css_alloc, .css_online = cpuset_css_online, diff --cc net/ipv6/ping.c index 9411c8d770a5,3e55447b63a4..fa65e92e9510 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c @@@ -152,9 -150,16 +152,11 @@@ int ping_v6_sendmsg(struct sock *sk, st rt = (struct rt6_info *) dst; np = inet6_sk(sk); - if (!np) - return -EBADF; + if (!np) { + err = -EBADF; + goto dst_err_out; + } - if (!fl6.flowi6_oif && ipv6_addr_is_multicast(&fl6.daddr)) - fl6.flowi6_oif = np->mcast_oif; - else if (!fl6.flowi6_oif) - fl6.flowi6_oif = np->ucast_oif; - pfh.icmph.type = user_icmph.icmp6_type; pfh.icmph.code = user_icmph.icmp6_code; pfh.icmph.checksum = 0;