Merge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro...
authorKevin Hilman <khilman@linaro.org>
Mon, 11 May 2015 23:36:52 +0000 (16:36 -0700)
committerKevin Hilman <khilman@linaro.org>
Mon, 11 May 2015 23:36:52 +0000 (16:36 -0700)
* 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro-android:
  android: fiq_debugger: fix cut-off help message
  ipv4: Missing sk_nulls_node_init() in ping_unhash().
  android: base-cfg: add ALSA
  usb: gadget: add audio dependencies to USB_G_ANDROID
  SELinux: ss: Fix policy write for ioctl operations
  nf: IDLETIMER: Adds the uid field in the msg
  android: configs: Enable SELinux and its dependencies.
  SELinux: use deletion-safe iterator to free list
  subsystem: CPU FREQUENCY DRIVERS- Set cpu_load calculation on current frequency

android/configs/android-base.cfg
drivers/cpufreq/cpufreq_interactive.c
drivers/staging/android/fiq_debugger/fiq_debugger.c
drivers/usb/gadget/Kconfig
net/ipv4/ping.c
net/netfilter/xt_IDLETIMER.c
security/selinux/avc.c
security/selinux/ss/avtab.c

index 3ddcecd716beef3369ecf80352a2be5cc67da5c1..1bee5d614d1bc74e13073181911b73e4845c4af4 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_ANDROID_BINDER_IPC=y
 CONFIG_ANDROID_LOW_MEMORY_KILLER=y
 CONFIG_ARMV7_COMPAT=y
 CONFIG_ASHMEM=y
+CONFIG_AUDIT=y
 CONFIG_BLK_DEV_DM=y
 CONFIG_BLK_DEV_INITRD=y
 CONFIG_CGROUPS=y
@@ -51,6 +52,7 @@ CONFIG_IP_NF_MATCH_AH=y
 CONFIG_IP_NF_MATCH_ECN=y
 CONFIG_IP_NF_MATCH_TTL=y
 CONFIG_IP_NF_RAW=y
+CONFIG_IP_NF_SECURITY=y
 CONFIG_IP_NF_TARGET_MASQUERADE=y
 CONFIG_IP_NF_TARGET_NETMAP=y
 CONFIG_IP_NF_TARGET_REDIRECT=y
@@ -85,10 +87,12 @@ CONFIG_NETFILTER_XT_MATCH_TIME=y
 CONFIG_NETFILTER_XT_MATCH_U32=y
 CONFIG_NETFILTER_XT_TARGET_CLASSIFY=y
 CONFIG_NETFILTER_XT_TARGET_CONNMARK=y
+CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=y
 CONFIG_NETFILTER_XT_TARGET_IDLETIMER=y
 CONFIG_NETFILTER_XT_TARGET_MARK=y
 CONFIG_NETFILTER_XT_TARGET_NFLOG=y
 CONFIG_NETFILTER_XT_TARGET_NFQUEUE=y
+CONFIG_NETFILTER_XT_TARGET_SECMARK=y
 CONFIG_NETFILTER_XT_TARGET_TCPMSS=y
 CONFIG_NETFILTER_XT_TARGET_TPROXY=y
 CONFIG_NETFILTER_XT_TARGET_TRACE=y
@@ -110,6 +114,7 @@ CONFIG_NF_CONNTRACK_IRC=y
 CONFIG_NF_CONNTRACK_NETBIOS_NS=y
 CONFIG_NF_CONNTRACK_PPTP=y
 CONFIG_NF_CONNTRACK_SANE=y
+CONFIG_NF_CONNTRACK_SECMARK=y
 CONFIG_NF_CONNTRACK_TFTP=y
 CONFIG_NF_CT_NETLINK=y
 CONFIG_NF_CT_PROTO_DCCP=y
@@ -130,6 +135,11 @@ CONFIG_PREEMPT=y
 CONFIG_RESOURCE_COUNTERS=y
 CONFIG_RTC_CLASS=y
 CONFIG_RT_GROUP_SCHED=y
+CONFIG_SECURITY=y
+CONFIG_SECURITY_NETWORK=y
+CONFIG_SECURITY_SELINUX=y
+CONFIG_SND=y
+CONFIG_SOUND=y
 CONFIG_STAGING=y
 CONFIG_SWITCH=y
 CONFIG_SYNC=y
index 55c499df8bb88c05f07f34cfc69d61f74f3beddf..cb477d6a21d6260f6101a34d15a33211175635b8 100644 (file)
@@ -364,7 +364,7 @@ static void cpufreq_interactive_timer(unsigned long data)
        spin_lock_irqsave(&pcpu->target_freq_lock, flags);
        do_div(cputime_speedadj, delta_time);
        loadadjfreq = (unsigned int)cputime_speedadj * 100;
-       cpu_load = loadadjfreq / pcpu->target_freq;
+       cpu_load = loadadjfreq / pcpu->policy->cur;
        tunables->boosted = tunables->boost_val || now < tunables->boostpulse_endtime;
 
        if (cpu_load >= tunables->go_hispeed_load || tunables->boosted) {
index 7d6b4ae8a2cdb4a6bc8695e9bedc6cb3dbc869a6..1d733624d70a2ad078b6592339a67bac9a91fb17 100644 (file)
@@ -429,7 +429,8 @@ static void fiq_debugger_help(struct fiq_debugger_state *state)
                                " pc            PC status\n"
                                " regs          Register dump\n"
                                " allregs       Extended Register dump\n"
-                               " bt            Stack trace\n"
+                               " bt            Stack trace\n");
+       fiq_debugger_printf(&state->output,
                                " reboot [<c>]  Reboot with command <c>\n"
                                " reset [<c>]   Hard reset with command <c>\n"
                                " irqs          Interupt status\n"
index 67409fda70db2d2d2c2e17ce1e898f4b6e630467..9de2eb28085e3cac6ab385777625ef5e0cd0c4ac 100644 (file)
@@ -820,6 +820,9 @@ config USB_G_PRINTER
 
 config USB_G_ANDROID
        boolean "Android Composite Gadget"
+       depends on SND
+       select SND_PCM
+       select SND_RAWMIDI
        select USB_F_ACM
        select USB_LIBCOMPOSITE
        select USB_U_SERIAL
index 58c3a3cea4df18141380d564024b2602ebaf3a81..47d1c7e10d5479ab1fff871cf07382cc4db093dc 100644 (file)
@@ -154,6 +154,7 @@ void ping_unhash(struct sock *sk)
        if (sk_hashed(sk)) {
                write_lock_bh(&ping_table.lock);
                hlist_nulls_del(&sk->sk_nulls_node);
+               sk_nulls_node_init(&sk->sk_nulls_node);
                sock_put(sk);
                isk->inet_num = 0;
                isk->inet_sport = 0;
index f6562ba97a978a8b9deeb433e922d5d6fb28ea8f..ddf77f7fbe245069b9f5d151f974d5b98b220282 100644 (file)
@@ -48,6 +48,7 @@
 #include <linux/suspend.h>
 #include <linux/notifier.h>
 #include <net/net_namespace.h>
+#include <net/sock.h>
 
 struct idletimer_tg_attr {
        struct attribute attr;
@@ -73,6 +74,7 @@ struct idletimer_tg {
        bool work_pending;
        bool send_nl_msg;
        bool active;
+       uid_t uid;
 };
 
 static LIST_HEAD(idletimer_tg_list);
@@ -117,7 +119,8 @@ static void notify_netlink_uevent(const char *iface, struct idletimer_tg *timer)
        char iface_msg[NLMSG_MAX_SIZE];
        char state_msg[NLMSG_MAX_SIZE];
        char timestamp_msg[NLMSG_MAX_SIZE];
-       char *envp[] = { iface_msg, state_msg, timestamp_msg, NULL };
+       char uid_msg[NLMSG_MAX_SIZE];
+       char *envp[] = { iface_msg, state_msg, timestamp_msg, uid_msg, NULL };
        int res;
        struct timespec ts;
        uint64_t time_ns;
@@ -140,6 +143,16 @@ static void notify_netlink_uevent(const char *iface, struct idletimer_tg *timer)
                return;
        }
 
+       if (state) {
+               res = snprintf(uid_msg, NLMSG_MAX_SIZE, "UID=%u", timer->uid);
+               if (NLMSG_MAX_SIZE <= res)
+                       pr_err("message too long (%d)", res);
+       } else {
+               res = snprintf(uid_msg, NLMSG_MAX_SIZE, "UID=");
+               if (NLMSG_MAX_SIZE <= res)
+                       pr_err("message too long (%d)", res);
+       }
+
        time_ns = timespec_to_ns(&ts);
        res = snprintf(timestamp_msg, NLMSG_MAX_SIZE, "TIME_NS=%llu", time_ns);
        if (NLMSG_MAX_SIZE <= res) {
@@ -147,7 +160,8 @@ static void notify_netlink_uevent(const char *iface, struct idletimer_tg *timer)
                pr_err("message too long (%d)", res);
        }
 
-       pr_debug("putting nlmsg: <%s> <%s>\n", iface_msg, state_msg);
+       pr_debug("putting nlmsg: <%s> <%s> <%s> <%s>\n", iface_msg, state_msg,
+                timestamp_msg, uid_msg);
        kobject_uevent_env(idletimer_tg_kobj, KOBJ_CHANGE, envp);
        return;
 
@@ -298,6 +312,7 @@ static int idletimer_tg_create(struct idletimer_tg_info *info)
        info->timer->delayed_timer_trigger.tv_sec = 0;
        info->timer->delayed_timer_trigger.tv_nsec = 0;
        info->timer->work_pending = false;
+       info->timer->uid = 0;
        get_monotonic_boottime(&info->timer->last_modified_timer);
 
        info->timer->pm_nb.notifier_call = idletimer_resume;
@@ -321,7 +336,8 @@ out:
        return ret;
 }
 
-static void reset_timer(const struct idletimer_tg_info *info)
+static void reset_timer(const struct idletimer_tg_info *info,
+                       struct sk_buff *skb)
 {
        unsigned long now = jiffies;
        struct idletimer_tg *timer = info->timer;
@@ -334,6 +350,17 @@ static void reset_timer(const struct idletimer_tg_info *info)
        if (!timer_prev || time_before(timer->timer.expires, now)) {
                pr_debug("Starting Checkentry timer (Expired, Jiffies): %lu, %lu\n",
                                timer->timer.expires, now);
+
+               /* Stores the uid resposible for waking up the radio */
+               if (skb && (skb->sk)) {
+                       struct sock *sk = skb->sk;
+                       read_lock_bh(&sk->sk_callback_lock);
+                       if ((sk->sk_socket) && (sk->sk_socket->file) &&
+                   (sk->sk_socket->file->f_cred))
+                               timer->uid = sk->sk_socket->file->f_cred->uid;
+                       read_unlock_bh(&sk->sk_callback_lock);
+               }
+
                /* checks if there is a pending inactive notification*/
                if (timer->work_pending)
                        timer->delayed_timer_trigger = timer->last_modified_timer;
@@ -372,7 +399,7 @@ static unsigned int idletimer_tg_target(struct sk_buff *skb,
        }
 
        /* TODO: Avoid modifying timers on each packet */
-       reset_timer(info);
+       reset_timer(info, skb);
        return XT_CONTINUE;
 }
 
@@ -400,7 +427,7 @@ static int idletimer_tg_checkentry(const struct xt_tgchk_param *par)
        info->timer = __idletimer_tg_find_by_label(info->label);
        if (info->timer) {
                info->timer->refcnt++;
-               reset_timer(info);
+               reset_timer(info, NULL);
                pr_debug("increased refcnt of timer %s to %u\n",
                         info->label, info->timer->refcnt);
        } else {
index 5c8e7cfa9de395d1192c2cc12fae631ae8705a96..f3dbbc0f15dd5d3988fe639ac1fd5c2b38bf2879 100644 (file)
@@ -298,13 +298,15 @@ static void avc_operation_decision_free(
 
 static void avc_operation_free(struct avc_operation_node *ops_node)
 {
-       struct avc_operation_decision_node *od_node;
+       struct avc_operation_decision_node *od_node, *tmp;
 
        if (!ops_node)
                return;
 
-       list_for_each_entry(od_node, &ops_node->od_head, od_list)
+       list_for_each_entry_safe(od_node, tmp, &ops_node->od_head, od_list) {
+               list_del(&od_node->od_list);
                avc_operation_decision_free(od_node);
+       }
        kmem_cache_free(avc_operation_node_cachep, ops_node);
 }
 
index 2e4ff003abcdc137fcb4069c47d83b2d04e16089..dd7466cb2021d969788bfddc555fcebeb05fa68b 100644 (file)
@@ -565,6 +565,9 @@ int avtab_write_item(struct policydb *p, struct avtab_node *cur, void *fp)
                return rc;
 
        if (cur->key.specified & AVTAB_OP) {
+               rc = put_entry(&cur->datum.u.ops->type, sizeof(u8), 1, fp);
+               if (rc)
+                       return rc;
                for (i = 0; i < ARRAY_SIZE(cur->datum.u.ops->op.perms); i++)
                        buf32[i] = cpu_to_le32(cur->datum.u.ops->op.perms[i]);
                rc = put_entry(buf32, sizeof(u32),