profile/mobile/platform/kernel/linux-3.10-sc7730.git
7 years agoBluetooth: Set le data length command and event 53/90653/2
Sudha Bheemanna [Mon, 3 Oct 2016 11:41:16 +0000 (17:11 +0530)]
Bluetooth: Set le data length command and event

Sets the data length for the le data packet with in the
advised limits. MGMT command and event are added to handle
the setting of data length.

Change-Id: Icc7db1a7361764fcb3d5a990357408942effe25d
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
7 years agoBluetooth: Read host suggested default le data length 49/90649/1
Sudha Bheemanna [Mon, 3 Oct 2016 11:10:04 +0000 (16:40 +0530)]
Bluetooth: Read host suggested default le data length

This patch adds MGMT command and code for supporting reading
default le data length value set at the controller.

Change-Id: I96d33e17259e847df443d63536a92930e46b02a1
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
7 years agoBluetooth: Write host suggested default le data length 46/90646/1
Sudha Bheemanna [Mon, 3 Oct 2016 10:56:38 +0000 (16:26 +0530)]
Bluetooth: Write host suggested default le data length

This patch adds MGMT command and code for supporting write
default le data length command to the controller.

Change-Id: Icc3509186261831cad7be98708a13bfa49730d93
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
7 years agoBluetooth: Read LE Max data length command 45/90645/1
Sudha Bheemanna [Mon, 3 Oct 2016 10:30:53 +0000 (16:00 +0530)]
Bluetooth: Read LE Max data length command

This patch adds the MGMT command and code to support reading
the maximum data length supported command for LE.

Change-Id: I3fd266b3a2fe0be755d2f00a38a603a2f887a938
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
7 years agoBluetooth: IPSP Connect/Disconnect apis 33/90633/1
Sudha Bheemanna [Mon, 3 Oct 2016 09:16:09 +0000 (14:46 +0530)]
Bluetooth: IPSP Connect/Disconnect apis

This patch adds MGMT code to support IPSP connect and
disconnect apis and handle connection state changed event.

Change-Id: I372ea923acd06c25cfa4c50094bf946e55dc30c8
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
7 years agoBluetooth: Add support to enable/disable IPSP 11/90611/1
Sudha Bheemanna [Mon, 3 Oct 2016 06:06:17 +0000 (11:36 +0530)]
Bluetooth: Add support to enable/disable IPSP

This patch supports MGMT commands and code to enable or disable
IPSP 6LowPan features.

Change-Id: I4fa404d01493562251b821a68a400a5e05d48078
Signed-off-by: Sudha Bheemanna <b.sudha@samsung.com>
7 years agokmsg: format back to previous for /dev/kmsg 16/88816/4 accepted/tizen/3.0/mobile/20161015.033718 accepted/tizen/mobile/20160927.021034 submit/tizen/20160926.022655 submit/tizen_3.0_mobile/20161015.000004
Michal Bloch [Tue, 20 Sep 2016 15:21:25 +0000 (17:21 +0200)]
kmsg: format back to previous for /dev/kmsg

 * no binary characters and no \0 at the end
 * done because the new format breaks various tools (such as sd-journal)
 * only affects prime /dev/kmsg, the additional /dev/kmsg12 etc unaffected

Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Change-Id: Icafebabe08f960fa7a2766b91ab2a72e8d2891b6

7 years agoARM: tizen_tm1_defconfig: disable smack_netfilter temporarily 34/88734/4 accepted/tizen/mobile/20160921.081224 submit/tizen/20160921.021059
jooseong lee [Tue, 20 Sep 2016 10:36:24 +0000 (19:36 +0900)]
ARM: tizen_tm1_defconfig: disable smack_netfilter temporarily

smack_netfilter was enabled to check network permission in Nether.
But it makes unintended Smack denial issue. For stability, we disable
smack_netfilter temporarily untill fixing the problem.

Change-Id: I63636e6bda95c35976c0fed5c49ff6bf359aa657
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agousb: gadget: g_ffs: Allow to set bmAttributes of configuration 36/88036/3 submit/tizen/20160920.104315
Krzysztof Opasiak [Mon, 12 Sep 2016 20:19:31 +0000 (22:19 +0200)]
usb: gadget: g_ffs: Allow to set bmAttributes of configuration

usb host tests expect configuration bmAttributes to have
a predefined value. As on 3.10 kernel we cannot use
ConfigFS to achieve this let's add a module parameter
which allows us to set it.

Change-Id: Iecf773d98c398ce1d3c529e7202155fb1e5e9ba6
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agousb: gadget: g_ffs: Allow to set configuration string 35/88035/3
Krzysztof Opasiak [Mon, 12 Sep 2016 20:23:26 +0000 (22:23 +0200)]
usb: gadget: g_ffs: Allow to set configuration string

usb host tests expect configuration string to have
a predefined value. As on 3.10 kernel we cannot use
ConfigFS to achieve this let's add a module parameter
which allows us to set it.

Change-Id: I7556ef87fb4da7ae1f86fa4f110f78ffd5d2b854
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agousb: gadget: fix: Call usb_gadget_connect() for dummy_udc 34/88034/1
Krzysztof Opasiak [Mon, 12 Sep 2016 18:54:59 +0000 (20:54 +0200)]
usb: gadget: fix: Call usb_gadget_connect() for dummy_udc

Ugly hack which comes from Android removes a call
to usb_gadget_connect() in udc_bind_to_driver() to
prevent android/slp gadget from communication before
userspace explicitly enables it.

Mainline gadgets (like g_ffs) expect this function
to be called as they don't have any sysfs interface
to enable them later.

As for usb-host API tests we need to use dummy_hcd
and g_ffs let's call usb_gadget_connect() for all
dummy_udc's.

Change-Id: I782bbb51c54e0b87ff6ef976070b6d8870a1a745
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agousb: gadget: f_fs: add poll for endpoint 0 66/87866/2 accepted/tizen/mobile/20160912.093254 submit/tizen/20160912.020407
Paweł Szewczyk [Wed, 7 Sep 2016 19:24:12 +0000 (21:24 +0200)]
usb: gadget: f_fs: add poll for endpoint 0

This patch adds poll function for file representing ep0.

Ability of read from or write to ep0 file is related with actual state of ffs:
- When desctiptors or strings are not written yet, POLLOUT flag is set.
- If there is any event to read, POLLIN flag is set.
- If setup request was read, POLLIN and POLLOUT flag is set, to allow
  send response (by performing I/O operation consistent with setup request
  direction) or set stall (by performing I/O operation opposite  setup
  request direction).

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
[Backported from mainline commit 23de91e]
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Change-Id: I4286847252357b4796cc3794ce71d5a4ec2af9f5

7 years agoInput: tc305k: remove event log 35/87235/2
Seung-Woo Kim [Wed, 7 Sep 2016 06:12:48 +0000 (15:12 +0900)]
Input: tc305k: remove event log

This patch removes key event log.

Change-Id: I86f1967e54be571ab41d6025a1443e3aa2a25fda
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agoInput: sc_keypad: remove event log 31/87231/2
Seung-Woo Kim [Wed, 7 Sep 2016 06:07:44 +0000 (15:07 +0900)]
Input: sc_keypad: remove event log

This patch removes key event log.

Change-Id: I3cbe04efcd4e16b30616c59f96a30cafa72b6827
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agoInput: sprd_eic_keys: remove event log 27/87227/2
Seung-Woo Kim [Wed, 7 Sep 2016 05:56:10 +0000 (14:56 +0900)]
Input: sprd_eic_keys: remove event log

This patch removes event log.

Change-Id: Iaeeaab3c71d3513edd3af51df5dbb870099fecd2
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agoInput: ist30xxc: remove touch event log 24/87224/3
Seung-Woo Kim [Wed, 7 Sep 2016 05:53:43 +0000 (14:53 +0900)]
Input: ist30xxc: remove touch event log

This patch removes touch event log.

Change-Id: I4a3ec5ccaf8455a48a8f67769c2056162a97c4de
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
7 years agousb: gadget: f_fs: remove build warnings from ffs_epfile_io 87/86787/1 accepted/tizen/mobile/20160905.065816 submit/tizen/20160905.022605
Seung-Woo Kim [Mon, 5 Sep 2016 01:52:21 +0000 (10:52 +0900)]
usb: gadget: f_fs: remove build warnings from ffs_epfile_io

This patch removes build warnings to convert unsigned int pointer
to char pointer from ffs_epfile_io().

Change-Id: I2b46093add10c647f3488220b123e3920a1cfeb4
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoBuild dummy_hcd and g_ffs as a modules 33/86533/3
Krzysztof Opasiak [Fri, 2 Sep 2016 10:52:40 +0000 (12:52 +0200)]
Build dummy_hcd and g_ffs as a modules

Change-Id: Ic505dd282eaf2740848fddbb98678d8fb147be1e
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoUpdate config for TM1 board due to changes in Kconfig 32/86532/2
Krzysztof Opasiak [Thu, 1 Sep 2016 16:49:43 +0000 (18:49 +0200)]
Update config for TM1 board due to changes in Kconfig

Just a simple update due to changes in Kconfig of usb
gadget subsystem.

Change-Id: I21f96fd9ac826efe8bb056a67f0bba62643f13c8
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agousb: gadget: Allow to build multiple legacy gadgets 31/86531/2
Krzysztof Opasiak [Thu, 1 Sep 2016 16:37:59 +0000 (18:37 +0200)]
usb: gadget: Allow to build multiple legacy gadgets

Currently it is possible to build in only one legac gadget *OR*
compile multiple of them as a modules. It's not possible to mix
those 2 ways of building them. This is limited only by Kconfig not
any functionality.

This patch removes this limitation. With this patch it is possible
to set up all build combinations:
1) Multiple gadgets build in
2) Some gadgets build in and some build as a modules
etc.

As this patch makes Kconfig quite complicated let me clarify how it works:

USB_F_<func name> - used in makefile for compilation
USB_G_<gadget name>_REQ_F_<func name> - set up by gadget to mark
      that this particular gadget requires this func to work
      USB_F_<func name>_SELECTOR - helper config which is used to determine
          if function should be build in or compiled as a module

Change-Id: I43b764ff27d08484df140835a6f2dee35d621248
Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
7 years agoSmack: Fix wrong backporting for Smack 67/86667/2
jooseong lee [Fri, 2 Sep 2016 08:09:30 +0000 (17:09 +0900)]
Smack: Fix wrong backporting for Smack

Regard of:
Smack: secmark support for netfilter (d587ffac0e6b0849334d575bca4e9e1caa48f891)

Smack used to use a mix of smack_known struct and char* throughout its
APIs and implementation. I confused it. It should be char*, not smack_known struct.

(The latest kernel has a unified format, smack_known struct.)

Change-Id: Ifd93e8b3d85c867c8d7a903470abc45e589a1a37
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agobuild: scripts: add input parameters to sprd_mkdzimage.sh 10/86310/1
Seung-Woo Kim [Wed, 31 Aug 2016 11:21:04 +0000 (20:21 +0900)]
build: scripts: add input parameters to sprd_mkdzimage.sh

Instead of fixed kernel and dtb files, this patch adds input
parameters to get proper kernel and dtb files.

Change-Id: Icd253cff63e7bccf12ddead4360417da05a7c7ef
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agobuild: scripts: add input parameters to sprd_dtbtool.sh 28/86228/1
Seung-Woo Kim [Wed, 31 Aug 2016 04:33:11 +0000 (13:33 +0900)]
build: scripts: add input parameters to sprd_dtbtool.sh

Instead of fixed dtb file list and its hw platform information,
this patch adds input parameters to get proper dtb files and to
consider reversed dtc hw platform information.

Change-Id: I29b8da3c3520ac6619777d1b4e4456a32d28ba44
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agopackaging: remove not used release type build parameter 80/85880/2
Seung-Woo Kim [Mon, 29 Aug 2016 10:15:29 +0000 (19:15 +0900)]
packaging: remove not used release type build parameter

There is not build parameter about release type, and it does not
really fix anything. So this patch removes not used release type
build parameter from packaging spec file.

Change-Id: I930e9beff52ce884f5676da93dbfe847f0fff576
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agotcp: make challenge acks less predictable 65/85865/1
Charles (Chas) Williams [Tue, 16 Aug 2016 20:50:11 +0000 (16:50 -0400)]
tcp: make challenge acks less predictable

commit 75ff39ccc1bd5d3c455b6822ab09e533c551f758 upstream.

From: Eric Dumazet <edumazet@google.com>

Yue Cao claims that current host rate limiting of challenge ACKS
(RFC 5961) could leak enough information to allow a patient attacker
to hijack TCP sessions. He will soon provide details in an academic
paper.

This patch increases the default limit from 100 to 1000, and adds
some randomization so that the attacker can no longer hijack
sessions without spending a considerable amount of probes.

Based on initial analysis and patch from Linus.

Note that we also have per socket rate limiting, so it is tempting
to remove the host limit in the future.

v2: randomize the count of challenge acks per second, not the period.

Fixes: 282f23c6ee34 ("tcp: implement RFC 5961 3.2")
Reported-by: Yue Cao <ycao009@ucr.edu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ ciwillia: backport to 3.10-stable ]
Signed-off-by: Chas Williams <ciwillia@brocade.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
[Apply from linux-3.10.y to fix CVE-2016-5696]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: Ida4b2baa58464341147f2ef082c6c6002f9c799a

7 years agoARM: tizen_tm1_defconfig: enable netfilter_audit and smack_netfilter 17/68317/3 accepted/tizen/mobile/20160829.085202 submit/tizen/20160829.013616
jooseong lee [Tue, 3 May 2016 10:40:36 +0000 (19:40 +0900)]
ARM: tizen_tm1_defconfig: enable netfilter_audit and smack_netfilter

This patch enables smack netfilter to support nether serivce.
Nether is for network access control in Tizen3.0.

Change-Id: I011f5b2a51583d493d4d5bbc6f7165782b468913
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agonetfilter: nfnetlink_queue: add security context information 16/68316/2
Roman Kubiak [Tue, 12 Apr 2016 05:41:30 +0000 (14:41 +0900)]
netfilter: nfnetlink_queue: add security context information

This patch adds an additional attribute when sending
packet information via netlink in netfilter_queue module.
It will send additional security context data, so that
userspace applications can verify this context against
their own security databases.

Change-Id: I1f8e8bea84e05abfc78808f6fccc513aa5bb0a9f
Signed-off-by: Roman Kubiak <r.kubiak@samsung.com>
Acked-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agonetfilter: Fix build failure in nfnetlink_queue_core.c. 15/68315/2
David S. Miller [Tue, 12 Apr 2016 05:17:16 +0000 (14:17 +0900)]
netfilter: Fix build failure in nfnetlink_queue_core.c.

net/netfilter/nfnetlink_queue_core.c: In function 'nfqnl_put_sk_uidgid':
net/netfilter/nfnetlink_queue_core.c:304:35: error: 'TCP_TIME_WAIT' undeclared (first use in this function)
net/netfilter/nfnetlink_queue_core.c:304:35: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [net/netfilter/nfnetlink_queue_core.o] Error 1

Just a missing include of net/tcp_states.h

Change-Id: Ie82a35d53e3b73c5838b2b4a6c539a6d4251d4af
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agonetfilter: nfnetlink_queue: enable UID/GID socket info retrieval 14/68314/2
Valentina Giusti [Tue, 12 Apr 2016 05:13:52 +0000 (14:13 +0900)]
netfilter: nfnetlink_queue: enable UID/GID socket info retrieval

Thanks to commits 41063e9 (ipv4: Early TCP socket demux) and 421b388
(udp: ipv4: Add udp early demux) it is now possible to parse UID and
GID socket info also for incoming TCP and UDP connections. Having
this info available, it is convenient to let NFQUEUE parse it in
order to improve and refine the traffic analysis in userspace.

Change-Id: Ie38c073a3543534497ef0cc6080642c808690b85
Signed-off-by: Valentina Giusti <valentina.giusti@bmw-carit.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agonetfilter: nfnetlink_queue: allow to attach expectations to conntracks 13/68313/2
Pablo Neira Ayuso [Wed, 7 Aug 2013 16:13:20 +0000 (18:13 +0200)]
netfilter: nfnetlink_queue: allow to attach expectations to conntracks

This patch adds the capability to attach expectations via nfnetlink_queue.
This is required by conntrack helpers that trigger expectations based on
the first packet seen like the TFTP and the DHCPv6 user-space helpers.

Change-Id: I1944cc4c4660b41d4eeafd44e3038bd2749ae655
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agoSmack: secmark connections 12/68312/2
Casey Schaufler [Tue, 26 Apr 2016 07:40:01 +0000 (16:40 +0900)]
Smack: secmark connections

If the secmark is available us it on connection as
well as packet delivery.

Change-Id: I570e750dc3753908f361b894c470784ec00a468e
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoSmack: Repair netfilter dependency 11/68311/2
Casey Schaufler [Tue, 26 Apr 2016 07:36:31 +0000 (16:36 +0900)]
Smack: Repair netfilter dependency

On 1/23/2015 8:20 AM, Jim Davis wrote:
> Building with the attached random configuration file,
>
> security/smack/smack_netfilter.c: In function ‘smack_ipv4_output’:
> security/smack/smack_netfilter.c:55:6: error: ‘struct sk_buff’ has no
> member named ‘secmark’
>    skb->secmark = skp->smk_secid;
>       ^
> make[2]: *** [security/smack/smack_netfilter.o] Error 1

The existing Makefile used the wrong configuration option to
determine if smack_netfilter should be built. This sets it right.

Change-Id: Iba5ff1e171a49d9750884503d9a20d06463b5a2c
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
7 years agoSmack: secmark support for netfilter 10/68310/2
Casey Schaufler [Tue, 26 Apr 2016 07:28:27 +0000 (16:28 +0900)]
Smack: secmark support for netfilter

Smack uses CIPSO to label internet packets and thus provide
for access control on delivery of packets. The netfilter facility
was not used to allow for Smack to work properly without netfilter
configuration. Smack does not need netfilter, however there are
cases where it would be handy.

As a side effect, the labeling of local IPv4 packets can be optimized
and the handling of local IPv6 packets is just all out better.

The best part is that the netfilter tools use "contexts" that
are just strings, and they work just as well for Smack as they
do for SELinux.

All of the conditional compilation for IPv6 was implemented
by Rafal Krypa <r.krypa@samsung.com>

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
[jooseong.lee: Backported from mainline]
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
Change-Id: Ia4cf70850795c50ab9f2d58f4d1b42cca7411c21

7 years agobluetooth: Increase the manufacturer data type size 74/85374/3
Nagaraj D R [Thu, 5 May 2016 08:53:06 +0000 (14:23 +0530)]
bluetooth: Increase the manufacturer data type size

To support tizen specific manufacturer data, data length needs to be increased.

Change-Id: I2c7d5d01348074d09684b52fac4b106609327ab0
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
7 years agopackaging: remove BuildRequires for system-tools 56/84956/1
Joonyoung Shim [Mon, 22 Aug 2016 07:13:17 +0000 (16:13 +0900)]
packaging: remove BuildRequires for system-tools

TM1 kernel doesn't need system-tools package anymore, so remove
BuildRequires for system-tools.

Change-Id: I906a32f81f0b3c28518d7a1b610c01ddbc48c407
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agobuild: use scripts to make kernel binary 55/84955/1
Joonyoung Shim [Mon, 22 Aug 2016 07:13:08 +0000 (16:13 +0900)]
build: use scripts to make kernel binary

Use our scripts to make kernel binary instead of binaries of
system-tools package, then we can remove dependency with system-tools
package.

Change-Id: I86a2de0af8743eaa22d1de5fa7dc68debadfc43c
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoscripts: add sprd_mkdzimage.sh 54/84954/1
Joonyoung Shim [Mon, 22 Aug 2016 02:24:57 +0000 (11:24 +0900)]
scripts: add sprd_mkdzimage.sh

sprd_mkdzimage.sh is script file to make dzImage binary that is TM1
specific kernel binary from zImage and merged-dtb binary. This will
substitute mkdzimage binary of system-tools.

Change-Id: Idb78c73eb5b195b7122c9cc5a033ae136769cf79
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoscripts: add sprd_dtbtool.sh 53/84953/1
Joonyoung Shim [Thu, 18 Aug 2016 08:52:44 +0000 (17:52 +0900)]
scripts: add sprd_dtbtool.sh

sprd_dtbtool.sh is script file to make to one merged-dtb binary from
multi dtb binaries for TM1. This will substitute dtbtool binary of
system-tools.

Change-Id: I69b73426ee43e0a5de3d6b4f5a28ec8965da5c6d
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agopackaging: fix not to provide kernel-headers 66/83466/1 accepted/tizen/mobile/20160816.233604 submit/tizen/20160816.052346
Seung-Woo Kim [Thu, 11 Aug 2016 06:02:52 +0000 (15:02 +0900)]
packaging: fix not to provide kernel-headers

The kernel-headers pakcage is provided for common kernel headers
from linux-glibc-devel pacakge but currently, it is also provided
from tm1 kernel. So this patch fixes not to provide kernel-headers.

Change-Id: Idcf7b8c6f605eea0bc7f8a0f70d9443f9dfe2c39
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agowlan_cfg80211: Add SOFTAP WPS type to support WPS in tethering 59/82259/9 accepted/tizen/mobile/20160809.232534 submit/tizen/20160809.043430 submit/tizen/20160809.063303
Seonah Moon [Tue, 2 Aug 2016 09:00:56 +0000 (18:00 +0900)]
wlan_cfg80211: Add SOFTAP WPS type to support WPS in tethering

The tethering and soft AP should offer features of general APs.
The WPS is one of security types and standard to create a secure wireless home network.

This patch makes 80211 packets(beacon, probe response and associate response) include WPS ies.

Change-Id: I89f60d5ee7a797c48b80b9f3dbfa2eca6825b5f2
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
7 years agoMerge "wlan_cfg80211: Set the hidden ssid scan properly." into tizen
Joonyoung Shim [Tue, 9 Aug 2016 00:40:05 +0000 (17:40 -0700)]
Merge "wlan_cfg80211: Set the hidden ssid scan properly." into tizen

7 years agowlan_cfg80211: Set the hidden ssid scan properly. 66/81866/4
hyunuktak [Fri, 29 Jul 2016 01:42:41 +0000 (10:42 +0900)]
wlan_cfg80211: Set the hidden ssid scan properly.

"vif->cfg80211.hidden_ssid_scan" value is always setting as true although "ssid[i].ssid_len" value is zero.
If there are no ssids passed from celler, then unable to do ssid scan.
So it is needed to properly set it.

Change-Id: Id4064ab1b65b29a375c276c16c095309ca4a92b1
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
7 years agopackaging: exclude build except target TM1 36/82536/2
Seung-Woo Kim [Thu, 4 Aug 2016 00:35:23 +0000 (09:35 +0900)]
packaging: exclude build except target TM1

This patch excludes build except target TM1.

Change-Id: I21fd72c705af10bb61b7b99a4bb8b3d60babaee3
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoppp, slip: Validate VJ compression slot parameters completely 42/76542/2 accepted/tizen/mobile/20160804.080948 submit/tizen/20160803.053117
Ben Hutchings [Sun, 1 Nov 2015 16:22:53 +0000 (16:22 +0000)]
ppp, slip: Validate VJ compression slot parameters completely

[ Upstream commit 4ab42d78e37a294ac7bc56901d563c642e03c4ae ]

Currently slhc_init() treats out-of-range values of rslots and tslots
as equivalent to 0, except that if tslots is too large it will
dereference a null pointer (CVE-2015-7799).

Add a range-check at the top of the function and make it return an
ERR_PTR() on error instead of NULL.  Change the callers accordingly.

Compile-tested only.

Change-Id: I4bd504aa497919117fec9d5ba97365fcca266b4c
Reported-by: 郭永刚 <guoyonggang@360.cn>
References: http://article.gmane.org/gmane.comp.security.oss.general/17908
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoisdn_ppp: Add checks for allocation failure in isdn_ppp_open() 41/76541/2
Ben Hutchings [Sun, 1 Nov 2015 16:21:24 +0000 (16:21 +0000)]
isdn_ppp: Add checks for allocation failure in isdn_ppp_open()

[ Upstream commit 0baa57d8dc32db78369d8b5176ef56c5e2e18ab3 ]

Compile-tested only.

Change-Id: I32e9c951314f1ce66338c560aaa299b4536e4b93
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoUSB: whiteheat: fix potential null-deref at probe 40/76540/2
Johan Hovold [Wed, 23 Sep 2015 18:41:42 +0000 (11:41 -0700)]
USB: whiteheat: fix potential null-deref at probe

commit cbb4be652d374f64661137756b8f357a1827d6a4 upstream.

Fix potential null-pointer dereference at probe by making sure that the
required endpoints are present.

The whiteheat driver assumes there are at least five pairs of bulk
endpoints, of which the final pair is used for the "command port". An
attempt to bind to an interface with fewer bulk endpoints would
currently lead to an oops.

Fixes CVE-2015-5257.

Reported-by: Moein Ghasemzadeh <moein@istuary.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ib2b005674463119d8f6ebcaa1184cba668b1400e
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoUSB: mct_u232: add sanity checking in probe 39/76539/2
Oliver Neukum [Thu, 31 Mar 2016 16:04:24 +0000 (12:04 -0400)]
USB: mct_u232: add sanity checking in probe

commit 4e9a0b05257f29cf4b75f3209243ed71614d062e upstream.

An attack using the lack of sanity checking in probe is known. This
patch checks for the existence of a second port.

CVE-2016-3136

Signed-off-by: Oliver Neukum <ONeukum@suse.com>
CC: stable@vger.kernel.org
[johan: add error message ]
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Change-Id: Icd1c5482b10f647177c7793c93fc7b592df4e79e
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoUSB: cypress_m8: add endpoint sanity check 38/76538/2
Oliver Neukum [Thu, 31 Mar 2016 16:04:25 +0000 (12:04 -0400)]
USB: cypress_m8: add endpoint sanity check

commit c55aee1bf0e6b6feec8b2927b43f7a09a6d5f754 upstream.

An attack using missing endpoints exists.

CVE-2016-3137

Change-Id: I58a2e1025bf8f3f0ba3ce9e949c1fa80f78636ce
Signed-off-by: Oliver Neukum <ONeukum@suse.com>
CC: stable@vger.kernel.org
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agounix: properly account for FDs passed over unix sockets 37/76537/2
willy tarreau [Sun, 10 Jan 2016 06:54:56 +0000 (07:54 +0100)]
unix: properly account for FDs passed over unix sockets

[ Upstream commit 712f4aad406bb1ed67f3f98d04c044191f0ff593 ]

It is possible for a process to allocate and accumulate far more FDs than
the process' limit by sending them over a unix socket then closing them
to keep the process' fd count low.

This change addresses this problem by keeping track of the number of FDs
in flight per user and preventing non-privileged processes from having
more FDs in flight than their configured FD limit.

Change-Id: I5e4f12dada69f3c253ead12f893ccf5f88053765
Reported-by: socketpair@gmail.com
Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mitigates: CVE-2013-4312 (Linux 2.0+)
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agosplice: Apply generic position and size checks to each write 36/76536/2
Ben Hutchings [Thu, 29 Jan 2015 02:50:33 +0000 (02:50 +0000)]
splice: Apply generic position and size checks to each write

commit 894c6350eaad7e613ae267504014a456e00a3e2a from the 3.2-stable branch.

We need to check the position and size of file writes against various
limits, using generic_write_check().  This was not being done for
the splice write path.  It was fixed upstream by commit 8d0207652cbe
("->splice_write() via ->write_iter()") but we can't apply that.

CVE-2014-7822

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[Ben fixed it in 3.2 stable, i ported it to 3.10 stable]
Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: I10f6cd44e0223d515d905ee5f3043b5d22c31057
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoRDS: fix race condition when sending a message on unbound socket 35/76535/2
Quentin Casasnovas [Tue, 24 Nov 2015 22:13:21 +0000 (17:13 -0500)]
RDS: fix race condition when sending a message on unbound socket

Sasha's found a NULL pointer dereference in the RDS connection code when
sending a message to an apparently unbound socket.  The problem is caused
by the code checking if the socket is bound in rds_sendmsg(), which checks
the rs_bound_addr field without taking a lock on the socket.  This opens a
race where rs_bound_addr is temporarily set but where the transport is not
in rds_bind(), leading to a NULL pointer dereference when trying to
dereference 'trans' in __rds_conn_create().

Vegard wrote a reproducer for this issue, so kindly ask him to share if
you're interested.

I cannot reproduce the NULL pointer dereference using Vegard's reproducer
with this patch, whereas I could without.

Complete earlier incomplete fix to CVE-2015-6937:

  74e98eb08588 ("RDS: verify the underlying transport exists before creating a connection")

Cc: David S. Miller <davem@davemloft.net>
Cc: stable@vger.kernel.org
Change-Id: I697622374cf9a4b8d805fb5a58987cfe8646afed
Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com>
Reviewed-by: Sasha Levin <sasha.levin@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Signed-off-by: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agopipe: iovec: Fix memory corruption when retrying atomic copy as non-atomic 34/76534/2
Ben Hutchings [Tue, 16 Jun 2015 21:11:06 +0000 (22:11 +0100)]
pipe: iovec: Fix memory corruption when retrying atomic copy as non-atomic

pipe_iov_copy_{from,to}_user() may be tried twice with the same iovec,
the first time atomically and the second time not.  The second attempt
needs to continue from the iovec position, pipe buffer offset and
remaining length where the first attempt failed, but currently the
pipe buffer offset and remaining length are reset.  This will corrupt
the piped data (possibly also leading to an information leak between
processes) and may also corrupt kernel memory.

This was fixed upstream by commits f0d1bec9d58d ("new helper:
copy_page_from_iter()") and 637b58c2887e ("switch pipe_read() to
copy_page_to_iter()"), but those aren't suitable for stable.  This fix
for older kernel versions was made by Seth Jennings for RHEL and I
have extracted it from their update.

CVE-2015-1805

Change-Id: Iedade4714500e63ad26599fe7aaa91d886df84a9
References: https://bugzilla.redhat.com/show_bug.cgi?id=1202855
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agonetfilter: conntrack: disable generic tracking for known protocols 33/76533/2
Florian Westphal [Fri, 26 Sep 2014 09:35:42 +0000 (11:35 +0200)]
netfilter: conntrack: disable generic tracking for known protocols

commit db29a9508a9246e77087c5531e45b2c88ec6988b upstream.

Given following iptables ruleset:

-P FORWARD DROP
-A FORWARD -m sctp --dport 9 -j ACCEPT
-A FORWARD -p tcp --dport 80 -j ACCEPT
-A FORWARD -p tcp -m conntrack -m state ESTABLISHED,RELATED -j ACCEPT

One would assume that this allows SCTP on port 9 and TCP on port 80.
Unfortunately, if the SCTP conntrack module is not loaded, this allows
*all* SCTP communication, to pass though, i.e. -p sctp -j ACCEPT,
which we think is a security issue.

This is because on the first SCTP packet on port 9, we create a dummy
"generic l4" conntrack entry without any port information (since
conntrack doesn't know how to extract this information).

All subsequent packets that are unknown will then be in established
state since they will fallback to proto_generic and will match the
'generic' entry.

Our originally proposed version [1] completely disabled generic protocol
tracking, but Jozsef suggests to not track protocols for which a more
suitable helper is available, hence we now mitigate the issue for in
tree known ct protocol helpers only, so that at least NAT and direction
information will still be preserved for others.

 [1] http://www.spinics.net/lists/netfilter-devel/msg33430.html

Joint work with Daniel Borkmann.

Fixes CVE-2014-8160.

Change-Id: I8dbb1b870c0724acba5f20d353c856f16ec00ae0
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Zhiqiang Zhang <zhangzhiqiang.zhang@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agonet: add validation for the socket syscall protocol argument 32/76532/2
Hannes Frederic Sowa [Mon, 14 Dec 2015 21:03:39 +0000 (22:03 +0100)]
net: add validation for the socket syscall protocol argument

[ Upstream commit 79462ad02e861803b3840cc782248c7359451cd9 ]

郭永刚 reported that one could simply crash the kernel as root by
using a simple program:

int socket_fd;
struct sockaddr_in addr;
addr.sin_port = 0;
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_family = 10;

socket_fd = socket(10,3,0x40000000);
connect(socket_fd , &addr,16);

AF_INET, AF_INET6 sockets actually only support 8-bit protocol
identifiers. inet_sock's skc_protocol field thus is sized accordingly,
thus larger protocol identifiers simply cut off the higher bits and
store a zero in the protocol fields.

This could lead to e.g. NULL function pointer because as a result of
the cut off inet_num is zero and we call down to inet_autobind, which
is NULL for raw sockets.

kernel: Call Trace:
kernel:  [<ffffffff816db90e>] ? inet_autobind+0x2e/0x70
kernel:  [<ffffffff816db9a4>] inet_dgram_connect+0x54/0x80
kernel:  [<ffffffff81645069>] SYSC_connect+0xd9/0x110
kernel:  [<ffffffff810ac51b>] ? ptrace_notify+0x5b/0x80
kernel:  [<ffffffff810236d8>] ? syscall_trace_enter_phase2+0x108/0x200
kernel:  [<ffffffff81645e0e>] SyS_connect+0xe/0x10
kernel:  [<ffffffff81779515>] tracesys_phase2+0x84/0x89

I found no particular commit which introduced this problem.

Change-Id: I30cd09ffb9705304bcda7247fe28ac14c8bb20a9
CVE: CVE-2015-8543
Cc: Cong Wang <cwang@twopensource.com>
Reported-by: 郭永刚 <guoyonggang@360.cn>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoKEYS: close race between key lookup and freeing 31/76531/2
Sasha Levin [Mon, 29 Dec 2014 14:39:01 +0000 (09:39 -0500)]
KEYS: close race between key lookup and freeing

commit a3a8784454692dd72e5d5d34dcdab17b4420e74c upstream.

When a key is being garbage collected, it's key->user would get put before
the ->destroy() callback is called, where the key is removed from it's
respective tracking structures.

This leaves a key hanging in a semi-invalid state which leaves a window open
for a different task to try an access key->user. An example is
find_keyring_by_name() which would dereference key->user for a key that is
in the process of being garbage collected (where key->user was freed but
->destroy() wasn't called yet - so it's still present in the linked list).

This would cause either a panic, or corrupt memory.

Fixes CVE-2014-9529.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Iab7bb60ba1db5931cd8911ed04452cdb55358eda
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoKEYS: Fix race between read and revoke 30/76530/2
David Howells [Fri, 18 Dec 2015 01:34:26 +0000 (01:34 +0000)]
KEYS: Fix race between read and revoke

commit b4a1b4f5047e4f54e194681125c74c0aa64d637d upstream.

This fixes CVE-2015-7550.

There's a race between keyctl_read() and keyctl_revoke().  If the revoke
happens between keyctl_read() checking the validity of a key and the key's
semaphore being taken, then the key type read method will see a revoked key.

This causes a problem for the user-defined key type because it assumes in
its read method that there will always be a payload in a non-revoked key
and doesn't check for a NULL pointer.

Fix this by making keyctl_read() check the validity of a key after taking
semaphore instead of before.

I think the bug was introduced with the original keyrings code.

This was discovered by a multithreaded test program generated by syzkaller
(http://github.com/google/syzkaller).  Here's a cleaned up version:

#include <sys/types.h>
#include <keyutils.h>
#include <pthread.h>
void *thr0(void *arg)
{
key_serial_t key = (unsigned long)arg;
keyctl_revoke(key);
return 0;
}
void *thr1(void *arg)
{
key_serial_t key = (unsigned long)arg;
char buffer[16];
keyctl_read(key, buffer, 16);
return 0;
}
int main()
{
key_serial_t key = add_key("user", "%", "foo", 3, KEY_SPEC_USER_KEYRING);
pthread_t th[5];
pthread_create(&th[0], 0, thr0, (void *)(unsigned long)key);
pthread_create(&th[1], 0, thr1, (void *)(unsigned long)key);
pthread_create(&th[2], 0, thr0, (void *)(unsigned long)key);
pthread_create(&th[3], 0, thr1, (void *)(unsigned long)key);
pthread_join(th[0], 0);
pthread_join(th[1], 0);
pthread_join(th[2], 0);
pthread_join(th[3], 0);
return 0;
}

Build as:

cc -o keyctl-race keyctl-race.c -lkeyutils -lpthread

Run as:

while keyctl-race; do :; done

as it may need several iterations to crash the kernel.  The crash can be
summarised as:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000010
IP: [<ffffffff81279b08>] user_read+0x56/0xa3
...
Call Trace:
 [<ffffffff81276aa9>] keyctl_read_key+0xb6/0xd7
 [<ffffffff81277815>] SyS_keyctl+0x83/0xe0
 [<ffffffff815dbb97>] entry_SYSCALL_64_fastpath+0x12/0x6f

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Change-Id: Ie59035bed50d4e1aa2248a0bd5128a0f997ab29a
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agoBtrfs: make xattr replace operations atomic 29/76529/2
Filipe Manana [Sun, 9 Nov 2014 08:38:39 +0000 (08:38 +0000)]
Btrfs: make xattr replace operations atomic

commit 5f5bc6b1e2d5a6f827bc860ef2dc5b6f365d1339 upstream.

Replacing a xattr consists of doing a lookup for its existing value, delete
the current value from the respective leaf, release the search path and then
finally insert the new value. This leaves a time window where readers (getxattr,
listxattrs) won't see any value for the xattr. Xattrs are used to store ACLs,
so this has security implications.

This change also fixes 2 other existing issues which were:

*) Deleting the old xattr value without verifying first if the new xattr will
   fit in the existing leaf item (in case multiple xattrs are packed in the
   same item due to name hash collision);

*) Returning -EEXIST when the flag XATTR_CREATE is given and the xattr doesn't
   exist but we have have an existing item that packs muliple xattrs with
   the same name hash as the input xattr. In this case we should return ENOSPC.

A test case for xfstests follows soon.

Thanks to Alexandre Oliva for reporting the non-atomicity of the xattr replace
implementation.

Change-Id: I286d47858be086bb974cb4fa8eee5d32e8bee61d
Reported-by: Alexandre Oliva <oliva@gnu.org>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
[shengyong: backport to 3.10
 - FIX: CVE-2014-9710
 - adjust context
 - ASSERT() was added v3.12, so we do check with if statement
 - set the first parameter of btrfs_item_nr() as NULL, because it is not
   used, and is removed in v3.13
]
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Junghoon Kim <jhoon20.kim@samsung.com>
7 years agokmsg: allow binary characters 22/80722/3
Michal Bloch [Thu, 21 Jul 2016 11:41:02 +0000 (13:41 +0200)]
kmsg: allow binary characters

* do not touch unprintable characters. This is so that logs can have formatting
  such as newlines, tabulation, or colours.
* the textual part is now delimited by \0. This is because \n which used to be
  the delimiter is now available for logs.

Signed-off-by: Michal Bloch <m.bloch@samsung.com>
Change-Id: I030a4eab791f4468897d3dcdc5bb04549f30b2f7
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
7 years agoSmack: Assign smack_known_web label for kernel thread's socket in the sk_alloc_securi... 17/80717/4 accepted/tizen/mobile/20160720.055300 submit/tizen/20160720.020843
jooseong lee [Wed, 20 Jul 2016 01:07:11 +0000 (10:07 +0900)]
Smack: Assign smack_known_web label for kernel thread's socket in the sk_alloc_security hook

Creating struct sock by sk_alloc function in various kernel subsystems
like bluetooth dosen't call smack_socket_post_create(). In such case,
received sock label is the floor('_') label and makes access deny.

Refers to:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=7412301b76bd53ee53b860f611fc3b5b1c2245b5

Change-Id: I614c5f0e6d59be5ca6b49f0581edfef79fc334cf
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
7 years agosensors/ims1911: use deffered probe for i2c fail case from probe 68/78668/1
Seung-Woo Kim [Wed, 6 Jul 2016 10:59:19 +0000 (19:59 +0900)]
sensors/ims1911: use deffered probe for i2c fail case from probe

This patch fixes to use deffered probe error for i2c read fail
from probe.

Change-Id: Ic4bc12fef0c9dee69d98bbdfb1ed1d5f2c2f62de
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
7 years agoinput: touchkey: add resume function 09/75709/1 accepted/tizen/mobile/20160622.021317 submit/tizen/20160621.063915
Joonyoung Shim [Mon, 20 Jun 2016 09:42:18 +0000 (18:42 +0900)]
input: touchkey: add resume function

Now, there is only suspend function then it will cause a problem that
touchkey is not working after sleep, so add resume function.

It's enough only that resume function calls tc300k_input_open() because
suspend function calls just tc300k_input_close().

Change-Id: I2b96fe797a94fbd20cd3082c9460130dd6b848eb
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: tizen_tm1_defconfig: Enable mali400 r5p2_rel0 94/72694/1 accepted/tizen/mobile/20160602.230807 submit/tizen/20160602.064313
Joonyoung Shim [Tue, 10 May 2016 06:27:25 +0000 (15:27 +0900)]
ARM: tizen_tm1_defconfig: Enable mali400 r5p2_rel0

Enable mali400 r5p2_rel0 instead of r5p0_rel0.

Change-Id: I4f7f01788d91b6d4e9c102029cbfa5a1b5c3f300
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: r5p2_rel0: replace CONFIG_PM_RUNTIME to CONFIG_PM 34/71034/1 accepted/tizen/mobile/20160602.021755 submit/tizen/20160530.004744
Seung-Woo Kim [Mon, 23 May 2016 08:23:22 +0000 (17:23 +0900)]
ARM: mali400: r5p2_rel0: replace CONFIG_PM_RUNTIME to CONFIG_PM

After commit 464ed18ebdb6 ("PM: Eliminate CONFIG_PM_RUNTIME") which
is applied kernel version 3.19, PM_RUNTIME is eliminated. So this
patch replaces CONFIG_PM_RUNTIME to CONFIG_PM for kernel version
larger than 3.19.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
[jy0922.shim: apply to mali400 r5p2_rel0 with some modification]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Change-Id: Iab2e17c07b397fe164623e1ecec58c54296c83a7

7 years agoARM: mali400: r5p2_rel0: fix build error 80/70880/1 submit/tizen/20160525.020535
Joonyoung Shim [Mon, 23 May 2016 06:35:41 +0000 (15:35 +0900)]
ARM: mali400: r5p2_rel0: fix build error

Include pm_runtime.h to fix below build error when CONFIG_PM_RUNTIME is
disabled.

drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c: In function ‘mali_driver_suspend_scheduler’:
drivers/gpu/arm/mali400/r5p2_rel0/linux/mali_kernel_linux.c:595:2: error: implicit declaration of function ‘pm_runtime_active’ [-Werror=implicit-function-declaration]
  if (pm_runtime_active(dev))
  ^

Change-Id: Ic613dd9785a9d563e50361328944bd23d33fd70c
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: fix building out of tree 53/69853/2
Joonyoung Shim [Tue, 17 May 2016 04:58:08 +0000 (13:58 +0900)]
ARM: mali400: fix building out of tree

s/$(src)/$(srctree)\/$(src)/

$(srctree) has absolute path of kernel root directory, so with this
commit, building problem by relative path will be gone from outside of
kernel tree.

Change-Id: Ib6e4a23a5858b029c75b7e760082846a2247f21a
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: r5p2_rel0: add GLES mem profiler feature 56/69356/2
YoungJun Cho [Tue, 21 Jul 2015 04:19:27 +0000 (13:19 +0900)]
ARM: mali400: r5p2_rel0: add GLES mem profiler feature

This patch adds GLES mem profiler feature.

You could use it by "cat /sys/kernel/debug/mali/gles_mem/<PID>".
Without user-DDK's MALI_IOC_MEM_PROFILE_GLES_MEM, it only show layout.

With this ioctl, you could check current GLES relevant memory status
in opened session and also check memory leakage in trash subdirectory.

The mechanism of detecting memory leakage is checking information when
the session is closed. So the user misses to free (GLES)memory during
session, it(the PID) could be found in trash.

Caution! When app is killed and the session is forcely shut down, then
it(the PID) could be found in trash but we can not guarantee there is a
real memory leakage. That is because like this case, it is impossible
to call MALI_IOC_MEM_PROFILE_GLES_MEM to remove allocated memory.

Change-Id: I78a08f7b53594dc20f8cc6f4c892250fdc9e8208
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
[jy0922.shim: applied to r5p2_rel0 from r5p0_rel0]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: r5p2_rel0: delete proprietary word in Kbuild 55/69355/2
YoungJun Cho [Thu, 2 Jul 2015 10:44:49 +0000 (19:44 +0900)]
ARM: mali400: r5p2_rel0: delete proprietary word in Kbuild

This is to guid for non-gpl case, not related with license,
but Tango detects it because it simply compares string.

Change-Id: Iad42e139fd5d040b3242f1e7358720ef24343570
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
[jy0922.shim: applied to r5p2_rel0 from r5p0_rel0]
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: r5p2_rel0: add sc8830 platform codes 54/69354/2
Joonyoung Shim [Tue, 10 May 2016 06:49:03 +0000 (15:49 +0900)]
ARM: mali400: r5p2_rel0: add sc8830 platform codes

This comes from r5p0_rel0.

Change-Id: I673ca4624c96f7aaedc15a5caa3ec72aeadb6656
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: r5p2_rel0: sync codes for TM1 from r5p0_rel0 53/69353/2
Joonyoung Shim [Tue, 10 May 2016 07:18:10 +0000 (16:18 +0900)]
ARM: mali400: r5p2_rel0: sync codes for TM1 from r5p0_rel0

Spectrum added some codes on r5p0_rel0 public, so do it on r5p2_rel0.
But except some codes related with below defines

SPRD_MEM_OPT_PAGE_TABLE_SHRINK
MALI_IOC_MEM_INIT
MALI_IOC_MEM_TERM

because we cannot add them by changed codes from r5p2_rel0.

Change-Id: I1423e7ce5181d4f1a08f3fbd01f9d426290eff29
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoARM: mali400: r5p2_rel0: fix Makefile & Kconfig 52/69352/2
Joonyoung Shim [Tue, 10 May 2016 05:59:10 +0000 (14:59 +0900)]
ARM: mali400: r5p2_rel0: fix Makefile & Kconfig

For building of r5p2_rel0.

Change-Id: I23c3144d886b9cbfe6061650ab16d180eb74e94c
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
7 years agoSmack: limited capability for changing process label 78/67278/2
Zbigniew Jasinski [Tue, 26 Apr 2016 06:54:45 +0000 (15:54 +0900)]
Smack: limited capability for changing process label

This feature introduces new kernel interface:

- <smack_fs>/relabel-self - for setting transition labels list

This list is used to control smack label transition mechanism.
List is set by, and per process. Process can transit to new label only if
label is on the list. Only process with CAP_MAC_ADMIN capability can add
labels to this list. With this list, process can change it's label without
CAP_MAC_ADMIN but only once. After label changing, list is unset.

Changes in v2:
* use list_for_each_entry instead of _rcu during label write
* added missing description in security/Smack.txt

Changes in v3:
* squashed into one commit

Changes in v4:
* switch from global list to per-task list
* since the per-task list is accessed only by the task itself
  there is no need to use synchronization mechanisms on it

Changes in v5:
* change smackfs interface of relabel-self to the one used for onlycap
  multiple labels are accepted, separated by space, which
  replace the previous list upon write

Signed-off-by: Zbigniew Jasinski <z.jasinski@samsung.com>
Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
Acked-by: Casey Schaufler <casey@schaufler-ca.com>
[jooseong.lee: Backported from mainline]
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
Change-Id: Id16abb77e09f89fd6c9d950e6be76eab220b801f

7 years agoSmack: allow multiple labels in onlycap 45/66545/3
Rafal Krypa [Tue, 12 Apr 2016 01:48:51 +0000 (10:48 +0900)]
Smack: allow multiple labels in onlycap

Smack onlycap allows limiting of CAP_MAC_ADMIN and CAP_MAC_OVERRIDE to
processes running with the configured label. But having single privileged
label is not enough in some real use cases. On a complex system like Tizen,
there maybe few programs that need to configure Smack policy in run-time
and running them all with a single label is not always practical.
This patch extends onlycap feature for multiple labels. They are configured
in the same smackfs "onlycap" interface, separated by spaces.

Signed-off-by: Rafal Krypa <r.krypa@samsung.com>
[jooseong.lee: We applied this patch before but some codes are missed]
Signed-off-by: jooseong lee <jooseong.lee@samsung.com>
Change-Id: I4a312874be5b88d43f8af146ecde9552731dc454

8 years agoARM: mali400: r5p2_rel0: add public codes from ARM 51/69351/1
Joonyoung Shim [Tue, 10 May 2016 05:57:26 +0000 (14:57 +0900)]
ARM: mali400: r5p2_rel0: add public codes from ARM

This comes from DX910-SW-99002-r5p2-00rel0.tgz of ARM web site.

Change-Id: I8d556f4abba5497679068eec6540a1d7716f6ebb
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
8 years agoARM: tizen_tm1_defconfig: enable xts blk cipher config 46/69146/1 accepted/tizen/mobile/20160513.004416 submit/tizen/20160512.055745
Seung-Woo Kim [Thu, 12 May 2016 02:49:07 +0000 (11:49 +0900)]
ARM: tizen_tm1_defconfig: enable xts blk cipher config

For luks support on cryptsetup in system, xts blk cipher is
required. So this patch enables xts blk cipher config option.

Change-Id: I2b7495a3d9cee974542f817c6821577b8b57acf9
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
8 years agodrm/sprd: save pid/tgid in private file data 01/66501/1 accepted/tizen/mobile/20160421.011022 submit/tizen/20160420.073210
Joonyoung Shim [Tue, 22 Mar 2016 07:39:19 +0000 (16:39 +0900)]
drm/sprd: save pid/tgid in private file data

Let's save pid/tgid in private file data only once when gem object is
created or prime_fd is imported and use them on gem_info. This can solve
wrong pid/tgid information of gem_info node for imported gem object
found on tizen_3.0 platform.

Change-Id: Icfefe0d140ff2955144d509c862875d2d48241eb
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
8 years ago[Multiple Kmsg] avoid not-allowable mutex lock condition 49/64149/4 accepted/tizen/mobile/20160401.023658 submit/tizen/20160331.234726
Kunhoon Baik [Wed, 30 Mar 2016 08:59:31 +0000 (17:59 +0900)]
[Multiple Kmsg] avoid not-allowable mutex lock condition

Change-Id: Icd2c90535687558aa3f294471edb865ef178a5b4

8 years agobuild: change model name as tm1 75/63375/1 accepted/tizen/mobile/20160323.140035 submit/tizen/20160323.110241
Seung-Woo Kim [Wed, 23 Mar 2016 10:55:03 +0000 (19:55 +0900)]
build: change model name as tm1

The model name, tm1 hsould be used for build and module build. So
this patch fixes to change model name.

Change-Id: I0bf1aeacc54ca1bb88d684161c2ff531d160f1e5
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
8 years agopackaging: remove unnecessary dzImage-recovery 36/63136/1 submit/tizen/20160323.063948
Seung-Woo Kim [Tue, 22 Mar 2016 07:29:50 +0000 (16:29 +0900)]
packaging: remove unnecessary dzImage-recovery

This patch removes unnecessary dzImage-recovery from the package.

Change-Id: I5be95182a69566948930d5821bc7b5ffb8319f81
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
8 years agodrm/sprd: fix always gem creation of imported dma-buf 45/61145/4
Joonyoung Shim [Thu, 11 Feb 2016 02:01:03 +0000 (11:01 +0900)]
drm/sprd: fix always gem creation of imported dma-buf

The sprd_prime_import() creates gem object always even though there is
existing gem object that refers memory of imported dma-buf. This patch
will make to reuse existing gem object on this case.

Change-Id: I4aa31bd2a41a511774b9e1aaf150ddbf45728c22
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
8 years agokmsg: set config to use multiple kmssage at TM1 32/61832/1 accepted/tizen/mobile/20160311.061543 submit/tizen/20160311.022307 submit/tizen/20160330.015433 submit/tizen/20160330.024311
Kichan Kwon [Fri, 11 Mar 2016 01:51:32 +0000 (10:51 +0900)]
kmsg: set config to use multiple kmssage at TM1

Change-Id: I4eeaaf17b35ecae108d52f67e880e1e374b05955
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
8 years agokmsg: selftests 84/60884/3
Paul Osmialowski [Fri, 12 Feb 2016 15:01:23 +0000 (16:01 +0100)]
kmsg: selftests

this patch adds selftests framework and four test scenarios for kmsg. The framework shape and code was inspired by similar selftests framework for kdbus.

Signed-off-by: Paul Osmialowski <p.osmialowsk@samsung.com>
[Fixed multithreaded test bug: buffer size > LOG_LINE_MAX]
Signed-off-by: Kazimierz Krosman <k.krosman@samsung.com>
Change-Id: Icedc0fee86c90430dcdb59d592392fbac05b42f5

8 years agokmsg: add ioctl for kmsg* devices operating on buffers 83/60883/3
Marcin Niesluchowski [Thu, 21 May 2015 14:24:30 +0000 (16:24 +0200)]
kmsg: add ioctl for kmsg* devices operating on buffers

There is no possibility to clear additional kmsg buffers,
get size of them or know what size should be passed to read
file operation (too small size causes it to retrun -EINVAL).

Add following ioctls which solve those issues:
* KMSG_CMD_GET_BUF_SIZE
* KMSG_CMD_GET_READ_SIZE_MAX
* KMSG_CMD_CLEAR

Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Change-Id: Ideade7e0b5c66bde3415f3190059742bac79333b

8 years agokmsg: add ioctl for adding and deleting kmsg* devices 82/60882/3
Marcin Niesluchowski [Thu, 18 Jun 2015 09:31:00 +0000 (11:31 +0200)]
kmsg: add ioctl for adding and deleting kmsg* devices

There is no possibility to add/delete kmsg* buffers from userspace.

Adds following ioctl for main kmsg device adding and deleting
additional kmsg devices:
* KMSG_CMD_BUFFER_ADD
* KMSG_CMD_BUFFER_DEL

Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Change-Id: Idead7a787892706249f50f1a19ca7a568753845a

8 years agokmsg: add predefined _PID, _TID, _COMM keywords to kmsg* log dict 81/60881/3
Marcin Niesluchowski [Mon, 27 Apr 2015 09:20:34 +0000 (11:20 +0200)]
kmsg: add predefined _PID, _TID, _COMM keywords to kmsg* log dict

kmsg* devices write operation wrote no dict along with message
Due to usage of kmsg devices in userspace dict has been added
identifying pid, tid and comm of writing process.

Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Change-Id: Idead2fa29607785031e37542c2f48481b04f9949

8 years agokmsg: add function for adding and deleting additional buffers 80/60880/3
Marcin Niesluchowski [Mon, 20 Apr 2015 11:03:10 +0000 (13:03 +0200)]
kmsg: add function for adding and deleting additional buffers

Additional kmsg buffers should be created and deleted dynamically.

Adding two functions
* kmsg_sys_buffer_add() creates additional kmsg buffer returning minor
* kmsg_sys_buffer_del() deletes one based on provided minor

Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Change-Id: Idead13dfef110bc05fee3fcf91ce7d44b6e5a46c

8 years agokmsg: add additional buffers support to memory class 79/60879/3
Marcin Niesluchowski [Mon, 20 Jul 2015 12:52:06 +0000 (14:52 +0200)]
kmsg: add additional buffers support to memory class

Memory class does not support additional kmsg buffers.

Add additional kmsg buffers support to:
* devnode() callback of "mem" class
* file operations of major "mem" character device

Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Change-Id: Ideadca14d2f2e8abd653ab8677e04132b7d9757e

8 years agokmsg: introduce additional kmsg devices support 78/60878/3
Marcin Niesluchowski [Wed, 29 Apr 2015 17:37:05 +0000 (19:37 +0200)]
kmsg: introduce additional kmsg devices support

kmsg device provides operations on cyclic logging buffer used mainly
by kernel but also in userspace by privileged processes.

Additional kmsg devices keep the same log format but may be added
dynamically with custom size.

Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
Change-Id: Ideada11d07e2a9c9b8c342a1027a350c9531d6f1

8 years agoprintk: add one function for storing log in proper format 77/60877/2
Marcin Niesluchowski [Thu, 2 Jul 2015 14:54:51 +0000 (16:54 +0200)]
printk: add one function for storing log in proper format

Preparation commit for future changes purpose.

Separate code responsible for storing log message in proper format
from operations on consoles by putting it in another function.

Change-Id: Idead21785b8e8a57cd504471d0537a399b4d9cd9
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
8 years agoprintk: move code regarding log message storing format 76/60876/2
Marcin Niesluchowski [Thu, 2 Jul 2015 14:32:28 +0000 (16:32 +0200)]
printk: move code regarding log message storing format

Preparation commit for future changes purpose.

Moves some code responsible for storing log messages in proper format.

Change-Id: Idead14e73d498e1e9ecba2da0e897a99ee15c583
Signed-off-by: Marcin Niesluchowski <m.niesluchow@samsung.com>
8 years agoprintk: guard the amount written per line by devkmsg_read() 75/60875/2
Tejun Heo [Thu, 14 May 2015 15:36:36 +0000 (11:36 -0400)]
printk: guard the amount written per line by devkmsg_read()

This patchset updates netconsole so that it can emit messages with the
same header as used in /dev/kmsg which gives neconsole receiver full log
information which enables things like structured logging and detection
of lost messages.

This patch:

devkmsg_read() uses 8k buffer and assumes that the formatted output
message won't overrun which seems safe given LOG_LINE_MAX, the current use
of dict and the escaping method being used; however, we're planning to use
devkmsg formatting wider and accounting for the buffer size properly isn't
that complicated.

This patch defines CONSOLE_EXT_LOG_MAX as 8192 and updates devkmsg_read()
so that it limits output accordingly.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: David Miller <davem@davemloft.net>
Cc: Kay Sievers <kay@vrfy.org>
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change-Id: Idead54c1fb93161aebd0e00be0b66f96b907233b

8 years agoPreparation patch for KMSG. 74/60874/2
Michal Bloch [Thu, 11 Feb 2016 16:52:58 +0000 (17:52 +0100)]
Preparation patch for KMSG.

This is the first of a series of patches which implement KMSG, which is
a replacement for old android log devices, serving as a fast dlog backend.

The patches are not applied onto the original printk file, but to a copy.
This is to keep the codebase maintainable. Any future backports will be
able to merge conflictlessly and preprocessor macroes are prevented from
excessive piling in the original file.

This patch adds a MULTIPLE_KMSG config flag and creates the copy of the
printk file which will serve as the target of subsequent KMSG patches.

Change-Id: Idead56234820ff9d024da88310dc2e505cf051d0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
8 years agoEnable the Joystick(JOYDEV) 15/60915/1 accepted/tizen/mobile/20160305.092149 submit/tizen/20160304.021031
Hyuk Lee [Thu, 3 Mar 2016 02:35:41 +0000 (11:35 +0900)]
Enable the Joystick(JOYDEV)

Change-Id: Ieedec7196065b8b620b004180b30a9a4cfd4a6ab
Signed-off-by: Hyuk Lee <hyuk0512.lee@samsung.com>
8 years agovideo: sprdfd: disable ESD feature 02/60302/1 accepted/tizen/mobile/20160225.082924 submit/tizen/20160225.045551
Joonyoung Shim [Wed, 17 Feb 2016 00:53:58 +0000 (09:53 +0900)]
video: sprdfd: disable ESD feature

The problem that the screen had been changed to block was reported at
some targets. I'm not sure but it might be related with ESD feature of
sprdfd driver, so as workaround, disable ESD feature.

And add some #ifdef to avoid below build errors.

drivers/built-in.o: In function `sprd_enable_vblank':
/home/pub/git/public/tm1_tizen_3.0/linux-3.10-sc7730/drivers/gpu/drm/sprd/sprd_drm_irq.c:265: undefined reference to `panel_esd_enable'
drivers/built-in.o: In function `sprd_disable_vblank':
/home/pub/git/public/tm1_tizen_3.0/linux-3.10-sc7730/drivers/gpu/drm/sprd/sprd_drm_irq.c:284: undefined reference to `panel_esd_enable'

Change-Id: I9228d883b0aa874e45b14b8f07cec9810634ab47
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
8 years agoKEYS: Fix keyring ref leak in join_session_keyring() 24/58424/1
Yevgeny Pats [Tue, 19 Jan 2016 22:09:04 +0000 (22:09 +0000)]
KEYS: Fix keyring ref leak in join_session_keyring()

This fixes CVE-2016-0728.

If a thread is asked to join as a session keyring the keyring that's already
set as its session, we leak a keyring reference.

This can be tested with the following program:

#include <stddef.h>
#include <stdio.h>
#include <sys/types.h>
#include <keyutils.h>

int main(int argc, const char *argv[])
{
int i = 0;
key_serial_t serial;

serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
"leaked-keyring");
if (serial < 0) {
perror("keyctl");
return -1;
}

if (keyctl(KEYCTL_SETPERM, serial,
   KEY_POS_ALL | KEY_USR_ALL) < 0) {
perror("keyctl");
return -1;
}

for (i = 0; i < 100; i++) {
serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING,
"leaked-keyring");
if (serial < 0) {
perror("keyctl");
return -1;
}
}

return 0;
}

If, after the program has run, there something like the following line in
/proc/keys:

3f3d898f I--Q---   100 perm 3f3f0000     0     0 keyring   leaked-keyring: empty

with a usage count of 100 * the number of times the program has been run,
then the kernel is malfunctioning.  If leaked-keyring has zero usages or
has been garbage collected, then the problem is fixed.

Change-Id: I08e8b8e929575583a94b6c84826c8f05e4dca075
Reported-by: Yevgeny Pats <yevgeny@perception-point.io>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Acked-by: Prarit Bhargava <prarit@redhat.com>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: James Morris <james.l.morris@oracle.com>
[Backport from mainline commit 23567fd052a9abb6d67fe8e7a9ccdd9800a540f2 to resolve CVE-2016-0728]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
8 years agoTizen: drm/sprd: change pid information on gem_info. 16/57816/1 accepted/tizen/mobile/20160125.224821 submit/tizen/20160125.073527
Jin-young Jeon [Fri, 22 Jan 2016 03:01:22 +0000 (12:01 +0900)]
Tizen: drm/sprd: change pid information on gem_info.

Change-Id: If04b48e0fb9f24f0d2939d5ab7b1f6a62418e188
Signed-off-by: Jin-young Jeon <jy0.jeon@samsung.com>
8 years agogator: Merge gator version 5.23.1 86/57086/3
Hyeongsik Min [Fri, 15 Jan 2016 00:51:03 +0000 (09:51 +0900)]
gator: Merge gator version 5.23.1

Updated gator driver/daemon version from 5.20 to 5.23.1
Newer version supports ttrace annotation

Change-Id: If863ab4ccfd429cb8735635ed812823da8915f8d
Signed-off-by: Hyeongsik Min <hyeongsik.min@samsung.com>
8 years agostaging/ion: fix build warnings accepted/tizen/mobile/20160113.050904 submit/tizen/20160113.015730
Joonyoung Shim [Wed, 13 Jan 2016 00:44:54 +0000 (09:44 +0900)]
staging/ion: fix build warnings

This fixed below warnings.

include/video/ion_sprd.h:128:7: warning: ‘struct ion_handle’ declared inside parameter list
include/video/ion_sprd.h:128:7: warning: its scope is only this definition or declaration, which is probably not what you want
include/video/ion_sprd.h:129:29: warning: ‘struct ion_handle’ declared inside parameter list

drivers/staging/android/ion/ion.h:126:13: warning: ‘struct drm_gem_object’ declared inside parameter list
drivers/staging/android/ion/ion.h:126:13: warning: its scope is only this definition or declaration, which is probably not what you want

Change-Id: If51462fad12a1f7d20777835b39b1a276149cef1
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
8 years agostaging/ion: decrease gem reference count in release of dma-buf
Joonyoung Shim [Tue, 12 Jan 2016 02:03:42 +0000 (11:03 +0900)]
staging/ion: decrease gem reference count in release of dma-buf

Gem reference count is increased hen dma-buf is exported, so release
of dma-buf should decrease gem reference count.

Change-Id: Id298ea79aa14908860e5d87527813994dfdb790d
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Rohit kumar <rohit.kr@samsung.com>
8 years agodrm/sprd: include correct ion.h header file in sprd_drm
Rohit kumar [Wed, 6 Jan 2016 09:24:11 +0000 (14:54 +0530)]
drm/sprd: include correct ion.h header file in sprd_drm

This patch updates sprd_drm to include staging/ion header
file instead of include/linux/ion.h as we are now using
staging ion driver.

Change-Id: I799c8553aa43278ecab85bc55d518b572b5ef9ea
Signed-off-by: Rohit kumar <rohit.kr@samsung.com>
8 years agostaging/ion: sync ion.h with include/linux/ion.h
Rohit kumar [Tue, 12 Jan 2016 09:34:07 +0000 (15:04 +0530)]
staging/ion: sync ion.h with include/linux/ion.h

Change-Id: I7961603a6f9615cf7768841edf0168461b477007
Signed-off-by: Rohit kumar <rohit.kr@samsung.com>