From ede19ea0c47fb23f3fc779833d1e57cf76f3371e Mon Sep 17 00:00:00 2001 From: Yannick GICQUEL Date: Mon, 19 Oct 2015 15:57:07 +0200 Subject: kernel: smack security backport from kernel 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Here is the backport of all patches relating to smack support on kernel side. For more details, see file: meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/README Please note that patches are applied only if "smack" is in the ditro features. Here are the 2 lines to add in the local.conf OVERRIDES .= ":smack" DISTRO_FEATURES_append = " smack" Change-Id: I147a3532aec531f977d6ec34c576261835711f1e Signed-off-by: Yannick GICQUEL Signed-off-by: José Bollo --- ...he-bug-smackcipso-can-t-set-CIPSO-correct.patch | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0005-Smack-Fix-the-bug-smackcipso-can-t-set-CIPSO-correct.patch (limited to 'meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0005-Smack-Fix-the-bug-smackcipso-can-t-set-CIPSO-correct.patch') diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0005-Smack-Fix-the-bug-smackcipso-can-t-set-CIPSO-correct.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0005-Smack-Fix-the-bug-smackcipso-can-t-set-CIPSO-correct.patch new file mode 100644 index 0000000..d50aa45 --- /dev/null +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0005-Smack-Fix-the-bug-smackcipso-can-t-set-CIPSO-correct.patch @@ -0,0 +1,36 @@ +From 99c1ba83e749446ef633197f2f78642171baa30d Mon Sep 17 00:00:00 2001 +From: "Passion,Zhao" +Date: Mon, 3 Jun 2013 11:42:24 +0800 +Subject: [PATCH 05/54] Smack: Fix the bug smackcipso can't set CIPSO correctly + +Bug report: https://tizendev.org/bugs/browse/TDIS-3891 + +The reason is userspace libsmack only use "smackfs/cipso2" long-label interface, +but the code's logical is still for orginal fixed length label. Now update +smack_cipso_apply() to support flexible label (<=256 including tailing '\0') + +There is also a bug in kernel/security/smack/smackfs.c: +When smk_set_cipso() parsing the CIPSO setting from userspace, the offset of +CIPSO level should be "strlen(label)+1" instead of "strlen(label)" + +Signed-off-by: Passion,Zhao +--- + security/smack/smackfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/security/smack/smackfs.c b/security/smack/smackfs.c +index 3c79cba..ab16703 100644 +--- a/security/smack/smackfs.c ++++ b/security/smack/smackfs.c +@@ -881,7 +881,7 @@ static ssize_t smk_set_cipso(struct file *file, const char __user *buf, + if (format == SMK_FIXED24_FMT) + rule += SMK_LABELLEN; + else +- rule += strlen(skp->smk_known); ++ rule += strlen(skp->smk_known) + 1; + + ret = sscanf(rule, "%d", &maplevel); + if (ret != 1 || maplevel > SMACK_CIPSO_MAXLEVEL) +-- +2.1.4 + -- cgit 1.2.3-korg