summaryrefslogtreecommitdiff
path: root/security
AgeCommit message (Collapse)Author
2014-02-19SELinux: include definition of new capabilitiesEric Paris
The kernel has added CAP_WAKE_ALARM and CAP_EPOLLWAKEUP. We need to define these in SELinux so they can be mediated by policy. Change-Id: I8a3e0db15ec5f4eb05d455a57e8446a8c2b484c2 Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: James Morris <james.l.morris@oracle.com> [sds: rename epollwakeup to block_suspend to match upstream merge] Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: David Yu <davyu@nvidia.com> Reviewed-on: http://git-master/r/368033 Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
2014-01-04security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.08p7.40714 Bug 1423099 Synchronizes TF's LP1 wakeup with the recent changes of LP1 sleep sequence in the BSP. Change-Id: I41576f465a75e43f394a095991f7e079f4032578 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/348298 (cherry picked from commit e74d2529e015ae6b8bea02cf95880f68228e4364) Signed-off-by: David Yu <davyu@nvidia.com> Reviewed-on: http://git-master/r/351097 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Martin Chi <mchi@nvidia.com> Tested-by: Martin Chi <mchi@nvidia.com>
2014-01-02security: tf_driver: integrate latest TL releaseMartin Chi
Tegra4 version: TF_TEGRA4_AC02.08p6.40683 This version fixes LP1 wakeup sequence. The major problem was introduced by mistake in release 2.0.8p4. Synchronized SDRAM wakeup sequence in TF with the latest BSP. The other features are preserved unchanged. Bug 1363940 Bug 1380505 Change-Id: Ieb3a089f5f5a964186ad11b691acc254b4216f9d Signed-off-by: Martin Chi <mchi@nvidia.com> Reviewed-on: http://git-master/r/351176 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit
2013-10-13tegra: video: hdmi: WAR: ensure hdcp register access with clk enabledMin-wuk Lee
There is a race condition between hdcp upstream and hdmi disable during suspend/resume stress with hdmi plugged-in. WAR by making host1x/hdmi clk enabled and hdmi clk out of reset. Bug 1349507 Change-Id: I6870066358900d6f6798b3e20bc59bf5645f25b8 Original-author: Roger Hsieh <rhsieh@nvidia.com> Signed-off-by: Roger Hsieh <rhsieh@nvidia.com> Signed-off-by: Min-wuk Lee <mlee@nvidia.com> Reviewed-on: http://git-master/r/271389 (cherry picked from commit 8a2f117c4472919ec22263c858fbac1a91ee5e72) Reviewed-on: http://git-master/r/289848 Reviewed-by: Gabby Lee <galee@nvidia.com> Tested-by: Gabby Lee <galee@nvidia.com>
2013-09-23security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.08p5.40671 This version fixes the corruption of secure os(TF) stack which is caused by unexpected hardware cache activities at the time of core #0 wakes up from per-core power gating. Caches ON while go to sleep and L1 cache is all cleaned before the sleep, while L2 cache is selectively cleaned because it's preserved during the sleep of the cores so L2 cache has some dirty lines from the secure world. When core #0 wakes up, it turns on i-, d-caches but MMU is still off at this moment. During this time the wake up process starts synching (flushing) cache to SDRAM. Until MMU is ON, core #0 uses stacks data from SDRAM, not from the data cache. It is enough to flush the old line of stack to SDRAM in order to corrupt call-return linkage if it accidently happens during such stack usage. To fix this issue, TF cleans the cache lines related to secure os stack after they have been used last time just before returning to normal OS. Bug 1330053 Bug 1356121 Change-Id: I1b8ba453f9e4e0f21e65667b54ed5ce4bcee8ff1 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/276089 GVS: Gerrit_Virtual_Submit Reviewed-by: Bo Yan <byan@nvidia.com>
2013-09-16security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.08p3.40665 This version supports FIQ debugging. Bug 1295289 Bug 1321825 Change-Id: I8f8826a2237dbd36cc2f3b6b5e5e0cebbf62d145 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/261678 (cherry picked from commit 7849fa4d90a85b89fcb3d4ff8aa9a8aa70758fab) Reviewed-on: http://git-master/r/274415 GVS: Gerrit_Virtual_Submit Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2013-08-14Merge branch 'linux-3.4.57' into rel-17Deepak Nibade
Bug 1348440 Change-Id: If25c49f027dc2a69642f7ed4733e965962b2a5a2 Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
2013-07-30security: tf_driver: update with latest TL dropHyung Taek Ryoo
This change fixes abnormal signal handling in tf driver. Tf_daemon(user thread) is waiting for the signal when coming out of LP0, but tf_daemon never gets the signal because tf driver can't handle the signal properly. If there's a pending signal when coming out of LP0, this fix clears the pending signal. Bug 1244750 Bug 1309812 Change-Id: I7849866c7993af8716c17f6b7a06692271334664 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/253548 GVS: Gerrit_Virtual_Submit Reviewed-by: Karthik Iyer <karthiki@nvidia.com> Reviewed-by: Prashant Malani <pmalani@nvidia.com> Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-07-23security: tf_driver: update with latest TL dropHyung Taek Ryoo
K3.4 does not need this code maintain to PF_KTHREAD Bug 1244750 Change-Id: Iec2fdf2cf4646ea3415f370a45376b1757498854 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/250493 Reviewed-by: Karthik Iyer <karthiki@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2013-04-05security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.08.40475 1. This version improves TF time to go to sleep for secure cores (~20%) and wake up time both for secure (~25%) and non-secure (~50%) cores. 2. Apply missing arm errata for A15. Bug 1198125 Change-Id: Id9ca47a4a584ebab63d2ce9811de94b97aebdce8 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/216565 GVS: Gerrit_Virtual_Submit Reviewed-by: Bo Yan <byan@nvidia.com>
2013-03-28key: Fix resource leakAlan Cox
commit a84a921978b7d56e0e4b87ffaca6367429b4d8ff upstream. On an error iov may still have been reallocated and need freeing Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-20selinux: use GFP_ATOMIC under spin_lockDan Carpenter
commit 4502403dcf8f5c76abd4dbab8726c8e4ecb5cd34 upstream. The call tree here is: sk_clone_lock() <- takes bh_lock_sock(newsk); xfrm_sk_clone_policy() __xfrm_sk_clone_policy() clone_policy() <- uses GFP_ATOMIC for allocations security_xfrm_policy_clone() security_ops->xfrm_policy_clone_security() selinux_xfrm_policy_clone() Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14Fix: compat_rw_copy_check_uvector() misuse in aio, readv, writev, and ↵Mathieu Desnoyers
security keys commit 8aec0f5d4137532de14e6554fd5dd201ff3a3c49 upstream. Looking at mm/process_vm_access.c:process_vm_rw() and comparing it to compat_process_vm_rw() shows that the compatibility code requires an explicit "access_ok()" check before calling compat_rw_copy_check_uvector(). The same difference seems to appear when we compare fs/read_write.c:do_readv_writev() to fs/compat.c:compat_do_readv_writev(). This subtle difference between the compat and non-compat requirements should probably be debated, as it seems to be error-prone. In fact, there are two others sites that use this function in the Linux kernel, and they both seem to get it wrong: Now shifting our attention to fs/aio.c, we see that aio_setup_iocb() also ends up calling compat_rw_copy_check_uvector() through aio_setup_vectored_rw(). Unfortunately, the access_ok() check appears to be missing. Same situation for security/keys/compat.c:compat_keyctl_instantiate_key_iov(). I propose that we add the access_ok() check directly into compat_rw_copy_check_uvector(), so callers don't have to worry about it, and it therefore makes the compat call code similar to its non-compat counterpart. Place the access_ok() check in the same location where copy_from_user() can trigger a -EFAULT error in the non-compat code, so the ABI behaviors are alike on both compat and non-compat. While we are here, fix compat_do_readv_writev() so it checks for compat_rw_copy_check_uvector() negative return values. And also, fix a memory leak in compat_keyctl_instantiate_key_iov() error handling. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Acked-by: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-14keys: fix race with concurrent install_user_keyrings()David Howells
commit 0da9dfdd2cd9889201bc6f6f43580c99165cd087 upstream. This fixes CVE-2013-1792. There is a race in install_user_keyrings() that can cause a NULL pointer dereference when called concurrently for the same user if the uid and uid-session keyrings are not yet created. It might be possible for an unprivileged user to trigger this by calling keyctl() from userspace in parallel immediately after logging in. Assume that we have two threads both executing lookup_user_key(), both looking for KEY_SPEC_USER_SESSION_KEYRING. THREAD A THREAD B =============================== =============================== ==>call install_user_keyrings(); if (!cred->user->session_keyring) ==>call install_user_keyrings() ... user->uid_keyring = uid_keyring; if (user->uid_keyring) return 0; <== key = cred->user->session_keyring [== NULL] user->session_keyring = session_keyring; atomic_inc(&key->usage); [oops] At the point thread A dereferences cred->user->session_keyring, thread B hasn't updated user->session_keyring yet, but thread A assumes it is populated because install_user_keyrings() returned ok. The race window is really small but can be exploited if, for example, thread B is interrupted or preempted after initializing uid_keyring, but before doing setting session_keyring. This couldn't be reproduced on a stock kernel. However, after placing systemtap probe on 'user->session_keyring = session_keyring;' that introduced some delay, the kernel could be crashed reliably. Fix this by checking both pointers before deciding whether to return. Alternatively, the test could be done away with entirely as it is checked inside the mutex - but since the mutex is global, that may not be the best way. Signed-off-by: David Howells <dhowells@redhat.com> Reported-by: Mateusz Guzik <mguzik@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-06Merge branch 'linux-3.4.35' into rel-17Sachin Nikam
Bug 1243631 Change-Id: I915826047b2e20f0ad0a7d75df295c6cbf6e5b0a
2013-03-01security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.06.40323 Added support of secure interrupts in the custom drivers. Bug 969938 Change-Id: Ic08d0a9c73cf6ab2f147bf89377c306fbe58fd2a Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/202154 GVS: Gerrit_Virtual_Submit Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2013-02-12security: tf_driver: fix incorrect cpu affinity in tf_driverHyung Taek Ryoo
This change fixes incorrect cpu affinity after excuting tf_driver. The process using tf_driver sometimes can't be schecduled to available onlined cpu. It is because cpu affinity has changed after using tf_driver. tf_driver saves current cpu affinity by calling sched_getaffinity which returns cpu affinity AND-masked by onlined cpus. tf_driver should save just current cpu affinity, not cpu affinity AND-masked by onlined cpus. bug 1218943 cherry picked from commit bba209aa7fe8b4f52f5d42acc1b21d8f54c18fe0) Reviewed-on: http://git-master/r/#change,195830 Change-Id: I5fbc1e6a3c67fbd01e4f2f5321aea168f7ba07c9 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/198842 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2013-01-30security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.05.40075 1. The LP0 Warmboot code of TF has been updated to reflect last changes of Tegra bootloader. TF boot parameters which are passed to secure os are removed in warmboot code. They can't live in warmboot code anymore because of PKC boot feature in T114. 2. Disable L2 prefetch throttle to enhance performance. Bug 1211749 Change-Id: I09648482766ef117f200729ab7220655f93163a4 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/193165 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2013-01-27evm: checking if removexattr is not a NULLDmitry Kasatkin
commit a67adb997419fb53540d4a4f79c6471c60bc69b6 upstream. The following lines of code produce a kernel oops. fd = socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0); fchmod(fd, 0666); [ 139.922364] BUG: unable to handle kernel NULL pointer dereference at (null) [ 139.924982] IP: [< (null)>] (null) [ 139.924982] *pde = 00000000 [ 139.924982] Oops: 0000 [#5] SMP [ 139.924982] Modules linked in: fuse dm_crypt dm_mod i2c_piix4 serio_raw evdev binfmt_misc button [ 139.924982] Pid: 3070, comm: acpid Tainted: G D 3.8.0-rc2-kds+ #465 Bochs Bochs [ 139.924982] EIP: 0060:[<00000000>] EFLAGS: 00010246 CPU: 0 [ 139.924982] EIP is at 0x0 [ 139.924982] EAX: cf5ef000 EBX: cf5ef000 ECX: c143d600 EDX: c15225f2 [ 139.924982] ESI: cf4d2a1c EDI: cf4d2a1c EBP: cc02df10 ESP: cc02dee4 [ 139.924982] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 139.924982] CR0: 80050033 CR2: 00000000 CR3: 0c059000 CR4: 000006d0 [ 139.924982] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000 [ 139.924982] DR6: ffff0ff0 DR7: 00000400 [ 139.924982] Process acpid (pid: 3070, ti=cc02c000 task=d7705340 task.ti=cc02c000) [ 139.924982] Stack: [ 139.924982] c1203c88 00000000 cc02def4 cf4d2a1c ae21eefa 471b60d5 1083c1ba c26a5940 [ 139.924982] e891fb5e 00000041 00000004 cc02df1c c1203964 00000000 cc02df4c c10e20c3 [ 139.924982] 00000002 00000000 00000000 22222222 c1ff2222 cf5ef000 00000000 d76efb08 [ 139.924982] Call Trace: [ 139.924982] [<c1203c88>] ? evm_update_evmxattr+0x5b/0x62 [ 139.924982] [<c1203964>] evm_inode_post_setattr+0x22/0x26 [ 139.924982] [<c10e20c3>] notify_change+0x25f/0x281 [ 139.924982] [<c10cbf56>] chmod_common+0x59/0x76 [ 139.924982] [<c10e27a1>] ? put_unused_fd+0x33/0x33 [ 139.924982] [<c10cca09>] sys_fchmod+0x39/0x5c [ 139.924982] [<c13f4f30>] syscall_call+0x7/0xb [ 139.924982] Code: Bad EIP value. This happens because sockets do not define the removexattr operation. Before removing the xattr, verify the removexattr function pointer is not NULL. Signed-off-by: Dmitry Kasatkin <dmitry.kasatkin@intel.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-12-20security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.03.39731 1. Support GCC for Secure services and drivers 2. Enables hazard detection timeout at TF boot time on all cores Bug 1186790 Change-Id: I95adbb9d978ae36dc7b3550f8b3e169b95575091 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/172650 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-12-04security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.02.39373 Create a new SMC (0xFFFFFFE7) for no flush operations in cluster power down. Bug 969937 Change-Id: Ie91d1ab2560ab56ee9ca2c8f35757a9bb5222c26 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/168212 Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-11-28security: Add tracing for SecureOS measurementsCharles Tan
Add new tracepoint events for SecureOS-related tracing. The timestamp traces measure the number of cycles taken to switch between normal world and secure world using the CP15 cycle counter. Bug 1042455 Change-Id: Ia7f0718a0fcc399875a175670b80dfe33f79b95e Signed-off-by: Charles Tan <ctan@nvidia.com> Reviewed-on: http://git-master/r/159367 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Antti Miettinen <amiettinen@nvidia.com> Tested-by: Antti Miettinen <amiettinen@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-11-28security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra4 version: TF_TEGRA4_AC02.01.39197.zip Support PM features 1) Cluster power down(LP2) 2) Low Power SoC Suspend(LP0, LP1) 3) Dynamic CPU Core & Cluster Switching Bug 969937 Bug 1178454 Change-Id: I27d994e19c65eb928177c816dfa97be01ad5c1e1 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/166483 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
2012-11-26selinux: fix sel_netnode_insert() suspicious rcu dereferenceDave Jones
commit 88a693b5c1287be4da937699cb82068ce9db0135 upstream. =============================== [ INFO: suspicious RCU usage. ] 3.5.0-rc1+ #63 Not tainted ------------------------------- security/selinux/netnode.c:178 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active = 1, debug_locks = 0 1 lock held by trinity-child1/8750: #0: (sel_netnode_lock){+.....}, at: [<ffffffff812d8f8a>] sel_netnode_sid+0x16a/0x3e0 stack backtrace: Pid: 8750, comm: trinity-child1 Not tainted 3.5.0-rc1+ #63 Call Trace: [<ffffffff810cec2d>] lockdep_rcu_suspicious+0xfd/0x130 [<ffffffff812d91d1>] sel_netnode_sid+0x3b1/0x3e0 [<ffffffff812d8e20>] ? sel_netnode_find+0x1a0/0x1a0 [<ffffffff812d24a6>] selinux_socket_bind+0xf6/0x2c0 [<ffffffff810cd1dd>] ? trace_hardirqs_off+0xd/0x10 [<ffffffff810cdb55>] ? lock_release_holdtime.part.9+0x15/0x1a0 [<ffffffff81093841>] ? lock_hrtimer_base+0x31/0x60 [<ffffffff812c9536>] security_socket_bind+0x16/0x20 [<ffffffff815550ca>] sys_bind+0x7a/0x100 [<ffffffff816c03d5>] ? sysret_check+0x22/0x5d [<ffffffff810d392d>] ? trace_hardirqs_on_caller+0x10d/0x1a0 [<ffffffff8133b09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f [<ffffffff816c03a9>] system_call_fastpath+0x16/0x1b This patch below does what Paul McKenney suggested in the previous thread. Signed-off-by: Dave Jones <davej@redhat.com> Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Paul Moore <paul@paul-moore.com> Cc: Eric Paris <eparis@parisplace.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-30tf_driver: integrate latest TL releaseHyung Taek Ryoo
V9 version for Tegra3: TF_TEGRA3_AB02.02.38127 V9 version for Tegra4: TF_TEGRA4_AC02.01e1.38186 This package is the first release of Trusted Foundations v9 It supports all the features supported by TFv8 (i.e. TF_TEGRA3_AB01.13) 1) Dynamic loading of secure services is supported 2) ARM generic and Tegra specific code are regrouped in HAL driversthat can be repostlinked 3) The fix for imprecise abort observed during Widvine session bug 969937 bug 969981 Change-Id: I1fd0d0df21ead84fb226ba2e0a6b3cf463472a26 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/147176 GVS: Gerrit_Virtual_Submit Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-10-07Yama: handle 32-bit userspace prctlKees Cook
commit 2e4930eb7c8fb20a39dfb5f8a8f80402710dcea8 upstream. When running a 64-bit kernel and receiving prctls from a 32-bit userspace, the "-1" used as an unsigned long will end up being misdetected. The kernel is looking for 0xffffffffffffffff instead of 0xffffffff. Since prctl lacks a distinct compat interface, Yama needs to handle this translation itself. As such, support either value as meaning PR_SET_PTRACER_ANY, to avoid breaking the ABI for 64-bit. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: John Johansen <john.johansen@canonical.com> Signed-off-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra 3 version: TF_TEGRA3_AB01.16.37161 Improvements in maintenance operations of L2 Cache Controlller. Change-Id: Iddbd61b21b6d83548d5a8c636e26b07b3b4f1385 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/128948 (cherry picked from commit 9bc5ccb125f8c32733a73bbc560ee71ac143f359) Reviewed-on: http://git-master/r/131895 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: James Zhao <jamesz@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-08-21security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra 3 version: TF_TEGRA3_AB01.15.36932 1)Fix an issue in GIC controller 2)Add a task profiler option into the Trusted Foundations 3)Fixes the RCU stalls Change-Id: Ib137dc4f155765cb7d7084f1f9a6f75d3bf38116 Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-on: http://git-master/r/122808 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: James Zhao <jamesz@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com>
2012-08-20security: tf_driver: restore current task flagsChris Johnson
In K3.1, this code was setting PF_FREEZER_NOSIG, which meant freeze_task would signal this thread to TIF_FREEZE later. In K3.4, PF_FREEZER_NOSIG was removed and the code ported to toggle PF_KTHREAD instead. But, in the port we missed restoring the previous task value (leaving PF_KTHREAD still set). Bug 988873 Change-Id: I1071ea33c08c64288162cd628977081a422c716f Signed-off-by: Chris Johnson <cwj@nvidia.com> Reviewed-on: http://git-master/r/123535 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2012-08-13Merge commit 'v3.4.8' into android-t114-3.4-rebasedVarun Wadekar
Linux v3.4.8 Conflicts: drivers/net/tun.c kernel/power/suspend.c Change-Id: Ia26546425cd20f127dbf4dd58cfca41bda47d23d Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-08-09posix_types.h: Cleanup stale __NFDBITS and related definitionsJosh Boyer
commit 8ded2bbc1845e19c771eb55209aab166ef011243 upstream. Recently, glibc made a change to suppress sign-conversion warnings in FD_SET (glibc commit ceb9e56b3d1). This uncovered an issue with the kernel's definition of __NFDBITS if applications #include <linux/types.h> after including <sys/select.h>. A build failure would be seen when passing the -Werror=sign-compare and -D_FORTIFY_SOURCE=2 flags to gcc. It was suggested that the kernel should either match the glibc definition of __NFDBITS or remove that entirely. The current in-kernel uses of __NFDBITS can be replaced with BITS_PER_LONG, and there are no uses of the related __FDELT and __FDMASK defines. Given that, we'll continue the cleanup that was started with commit 8b3d1cda4f5f ("posix_types: Remove fd_set macros") and drop the remaining unused macros. Additionally, linux/time.h has similar macros defined that expand to nothing so we'll remove those at the same time. Reported-by: Jeff Law <law@redhat.com> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Josh Boyer <jwboyer@redhat.com> [ .. and fix up whitespace as per akpm ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-08security: tf_driver: integrate latest TL releaseHyung Taek Ryoo
Tegra 3 version: TF_TEGRA3_AB01.14.36781 1)Kernel boot addr in TF boot args, branch prediction activated early, fix in system driver mapping. 2)Several improvments in boot and L2CC operations 3)Fix to support Neon Signed-off-by: Hyung Taek Ryoo <hryoo@nvidia.com> Change-Id: I16ed5d46d196875dece1f0006a0b04dbfdb58d42 Reviewed-on: http://git-master/r/119790 Reviewed-by: James Zhao <jamesz@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-by: Dan Willemsen <dwillemsen@nvidia.com> Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Tested-by: Hyung Taek Ryoo <hryoo@nvidia.com>
2012-07-30security: tf_driver: integrate latest TL releaseKaran Jhavar
Tegra 3 version: TF_TEGRA3_AB01.11.35578, TF_TEGRA3_AB01.11p1.35578 TF_TEGRA3_AB01.11p2.36386, TF_TEGRA3_AB01.11p3.36518 TF_TEGRA3_AB01.11p4.36577, TF_TEGRA3_AB01.11p5.36677 1)Add memory profiling tool to debug secure services's stack and heap 2)Add support to enable dynamic clock gating feature in PL310 register 3)TEE client API at kernel level 4)Stable FIQ debugging (SDK ver 1.09) 5)clrex stability change 6)GIC controller stability settings 7)Fix LP1 8)Fix floating pt support Bug 1021831 Change-Id: I5c2a693a27dc591b62863aa0fe4ff65163e67aba Signed-off-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-on: http://git-master/r/117515 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Hyung Taek Ryoo <hryoo@nvidia.com> Reviewed-by: Marvin Zhang <mzhang@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
2012-06-19security: tf_driver integrate TL's latest SDKKaran Jhavar
Update TL's SDK to ver 01.12. New SDK adds - 1) LP2 exit time optimization 2) L2 cache optimization - stop only, no flush 3) PL310 - set dynamic clock gate 4) Support for TEEE client api's for drivers bug 996822 Change-Id: Id46b7dd153ef05cffeed76558fa7a8c50cae5bd7 Signed-off-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-on: http://git-master/r/108025 (cherry picked from commit 3f2b434827ef9456b12dab23339de19afa1ff77c) Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Change-Id: I44399a9c79dba6439858d1bcdf8cd8add1fb3a8b Reviewed-on: http://git-master/r/109535 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
2012-06-11Merge commit 'v3.4.2' into android-tegra-nv-3.4Varun Wadekar
Conflicts: drivers/i2c/busses/i2c-tegra.c drivers/usb/gadget/fsl_udc_core.c Change-Id: Ibfc3a8edc3665b832ddc94f89fc17b556629d104 Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-06-01SELinux: if sel_make_bools errors don't leave inconsistent stateEric Paris
commit 154c50ca4eb9ae472f50b6a481213e21ead4457d upstream. We reset the bool names and values array to NULL, but do not reset the number of entries in these arrays to 0. If we error out and then get back into this function we will walk these NULL pointers based on the belief that they are non-zero length. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-30tf_driver: integrate latest TL release:Marvin Zhang
Tegra 2 version: TF_TEGRA2_AA01.09.34784 Tegra 3 version: TF_TEGRA3_AB01.08.34931 Add dynamic support for UART used by the Secure World trace driver. The files are from the Tegra 3 version of SDK. Bug 960201. Change-Id: I14c3cfc35f81d3a37981e82760c2a2259164a904 Signed-off-by: Marvin Zhang <mzhang@nvidia.com> Reviewed-on: http://git-master/r/94306 (cherry picked from commit 173b55aa4d30fc3771719093d675972fca600cd3) Reviewed-on: http://git-master/r/104037 Reviewed-by: Chris Johnson <cwj@nvidia.com> Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Tested-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> GVS: Gerrit_Virtual_Submit
2012-05-14security: tf: resolve compilation time warningsSanjay Singh Rawat
bug 949219 Change-Id: Ia7d23d3aab631e6a78c53518bc1f608d46e8f341 Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-on: http://git-master/r/92260 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
2012-05-04security: tf_driver: update with latest TL dropChris Johnson
Tegra 2 version: TF_TEGRA2_AA01.07.34078 Tegra 3 version: TF_TEGRA3_AB01.06.34049 Bug 950169 Signed-off-by: Chris Johnson <cwj@nvidia.com> Reviewed-on: http://git-master/r/89927 (cherry picked from commit 28fc4a5b80a0f6db3e6dc50efd8c0412e2ae11bf) Change-Id: I41413b4f00d243e3bb56d44fb32eea29d0291401 Reviewed-on: http://git-master/r/90445 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Chris Johnson <cwj@nvidia.com> Tested-by: Chris Johnson <cwj@nvidia.com> Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Conflicts: security/tf_driver/tf_comm.c Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
2012-04-25security: fix compile error in commoncap.cJonghwan Choi
Add missing "personality.h" security/commoncap.c: In function 'cap_bprm_set_creds': security/commoncap.c:510: error: 'PER_CLEAR_ON_SETID' undeclared (first use in this function) security/commoncap.c:510: error: (Each undeclared identifier is reported only once security/commoncap.c:510: error: for each function it appears in.) Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2012-04-25fcaps: clear the same personality flags as suid when fcaps are usedEric Paris
If a process increases permissions using fcaps all of the dangerous personality flags which are cleared for suid apps should also be cleared. Thus programs given priviledge with fcaps will continue to have address space randomization enabled even if the parent tried to disable it to make it easier to attack. Signed-off-by: Eric Paris <eparis@redhat.com> Reviewed-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2012-04-25Smack: move label list initializationCasey Schaufler
A kernel with Smack enabled will fail if tmpfs has xattr support. Move the initialization of predefined Smack label list entries to the LSM initialization from the smackfs setup. This became an issue when tmpfs acquired xattr support, but was never correct. Signed-off-by: Casey Schaufler <casey@schaufler-ca.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2012-04-18security: Add config flag for Android specific capsPreetham Chandru
Add CONFIG_ANDROID_PARANOID_NETWORK for Android specific capabilities Change-Id: Ic9a44e4f754445fbf59a52e5aa75a2d8e3d0930f Signed-off-by: Preetham Chandru R <pchandru@nvidia.com> Reviewed-on: http://git-master/r/97519 Reviewed-by: Sanjay Singh Rawat <srawat@nvidia.com> Reviewed-by: Kiran Adduri <kadduri@nvidia.com> Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
2012-04-19security: fix compile error in commoncap.cJonghwan Choi
Add missing "personality.h" security/commoncap.c: In function 'cap_bprm_set_creds': security/commoncap.c:510: error: 'PER_CLEAR_ON_SETID' undeclared (first use in this function) security/commoncap.c:510: error: (Each undeclared identifier is reported only once security/commoncap.c:510: error: for each function it appears in.) Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com> Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2012-04-18Smack: build when CONFIG_AUDIT not definedKees Cook
This fixes builds where CONFIG_AUDIT is not defined and CONFIG_SECURITY_SMACK=y. This got introduced by the stack-usage reducation commit 48c62af68a40 ("LSM: shrink the common_audit_data data union"). Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Eric Paris <eparis@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18lsm_audit: don't specify the audit pre/post callbacks in 'struct ↵Linus Torvalds
common_audit_data' It just bloats the audit data structure for no good reason, since the only time those fields are filled are just before calling the common_lsm_audit() function, which is also the only user of those fields. So just make them be the arguments to common_lsm_audit(), rather than bloating that structure that is passed around everywhere, and is initialized in hot paths. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18SELinux: do not allocate stack space for AVC data unless neededEric Paris
Instead of declaring the entire selinux_audit_data on the stack when we start an operation on declare it on the stack if we are going to use it. We know it's usefulness at the end of the security decision and can declare it there. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18SELinux: remove avd from slow_avc_audit()Eric Paris
We don't use the argument, so remove it. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18SELinux: remove avd from selinux_audit_dataEric Paris
We do not use it. Remove it. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-18LSM: shrink the common_audit_data data unionEric Paris
After shrinking the common_audit_data stack usage for private LSM data I'm not going to shrink the data union. To do this I'm going to move anything larger than 2 void * ptrs to it's own structure and require it to be declared separately on the calling stack. Thus hot paths which don't need more than a couple pointer don't have to declare space to hold large unneeded structures. I could get this down to one void * by dealing with the key struct and the struct path. We'll see if that is helpful after taking care of networking. Signed-off-by: Eric Paris <eparis@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>