summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeokYeon Hwang <syeon.hwang@samsung.com>2016-07-20 14:56:48 +0900
committerSeokYeon Hwang <syeon.hwang@samsung.com>2016-07-20 14:57:31 +0900
commit84ae67f74cac354d05c961af4fa5af6d00559607 (patch)
tree4db721dedd41841ac738ee738537590623ea4ab2
parenta840792288a031c68849c71d4121b7b5ca4b6d9e (diff)
parent6e588814ea9a536ac74a7f09f127a6843a80d817 (diff)
downloademulator-kernel-84ae67f74cac354d05c961af4fa5af6d00559607.tar.gz
emulator-kernel-84ae67f74cac354d05c961af4fa5af6d00559607.tar.bz2
emulator-kernel-84ae67f74cac354d05c961af4fa5af6d00559607.zip
Merge branch 'tizen' into develop
Change-Id: Ib5270e50e8efaa535f905dcb73da222043071e98 Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
-rw-r--r--security/smack/smack_lsm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c
index 4213de5b5014..44731d3d5f65 100644
--- a/security/smack/smack_lsm.c
+++ b/security/smack/smack_lsm.c
@@ -2312,8 +2312,16 @@ static int smack_sk_alloc_security(struct sock *sk, int family, gfp_t gfp_flags)
if (ssp == NULL)
return -ENOMEM;
- ssp->smk_in = skp;
- ssp->smk_out = skp;
+ /*
+ * Sockets created by kernel threads receive web label.
+ */
+ if (unlikely(current->flags & PF_KTHREAD)) {
+ ssp->smk_in = &smack_known_web;
+ ssp->smk_out = &smack_known_web;
+ } else {
+ ssp->smk_in = skp;
+ ssp->smk_out = skp;
+ }
ssp->smk_packet = NULL;
sk->sk_security = ssp;