summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Hilman <khilman@linaro.org>2015-05-11 16:36:52 -0700
committerKevin Hilman <khilman@linaro.org>2015-05-11 16:36:52 -0700
commit2075186d012c815911494f34fc16aef7c8f3492b (patch)
tree5cf4dcdd6e0e61255a4671c1fbc97fd675136dc1
parent96ba231c1546b7c5d20e90437f45bd9089316b86 (diff)
parent52f479da0aef99cffafe73fa04dcbcfc0d4616dc (diff)
Merge branch 'linaro-android-3.10-lsk' of git://android.git.linaro.org/kernel/linaro-android into linux-linaro-lsk-v3.10-android
* '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
-rw-r--r--android/configs/android-base.cfg10
-rw-r--r--drivers/cpufreq/cpufreq_interactive.c2
-rw-r--r--drivers/staging/android/fiq_debugger/fiq_debugger.c3
-rw-r--r--drivers/usb/gadget/Kconfig3
-rw-r--r--net/ipv4/ping.c1
-rw-r--r--net/netfilter/xt_IDLETIMER.c37
-rw-r--r--security/selinux/avc.c6
-rw-r--r--security/selinux/ss/avtab.c3
8 files changed, 56 insertions, 9 deletions
diff --git a/android/configs/android-base.cfg b/android/configs/android-base.cfg
index 3ddcecd716b..1bee5d614d1 100644
--- a/android/configs/android-base.cfg
+++ b/android/configs/android-base.cfg
@@ -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
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c
index 55c499df8bb..cb477d6a21d 100644
--- a/drivers/cpufreq/cpufreq_interactive.c
+++ b/drivers/cpufreq/cpufreq_interactive.c
@@ -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) {
diff --git a/drivers/staging/android/fiq_debugger/fiq_debugger.c b/drivers/staging/android/fiq_debugger/fiq_debugger.c
index 7d6b4ae8a2c..1d733624d70 100644
--- a/drivers/staging/android/fiq_debugger/fiq_debugger.c
+++ b/drivers/staging/android/fiq_debugger/fiq_debugger.c
@@ -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"
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 67409fda70d..9de2eb28085 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -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
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 58c3a3cea4d..47d1c7e10d5 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -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;
diff --git a/net/netfilter/xt_IDLETIMER.c b/net/netfilter/xt_IDLETIMER.c
index f6562ba97a9..ddf77f7fbe2 100644
--- a/net/netfilter/xt_IDLETIMER.c
+++ b/net/netfilter/xt_IDLETIMER.c
@@ -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 {
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index 5c8e7cfa9de..f3dbbc0f15d 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -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);
}
diff --git a/security/selinux/ss/avtab.c b/security/selinux/ss/avtab.c
index 2e4ff003abc..dd7466cb202 100644
--- a/security/selinux/ss/avtab.c
+++ b/security/selinux/ss/avtab.c
@@ -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),