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 --- .../0020-Smack-File-receive-audit-correction.patch | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0020-Smack-File-receive-audit-correction.patch (limited to 'meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0020-Smack-File-receive-audit-correction.patch') diff --git a/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0020-Smack-File-receive-audit-correction.patch b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0020-Smack-File-receive-audit-correction.patch new file mode 100644 index 0000000..cb8a86f --- /dev/null +++ b/meta-rcar-gen2/recipes-kernel/linux/linux-renesas/smack/0020-Smack-File-receive-audit-correction.patch @@ -0,0 +1,39 @@ +From bc7377d7cd27b9d17384e1486ac769a37cf8f745 Mon Sep 17 00:00:00 2001 +From: Casey Schaufler +Date: Mon, 30 Dec 2013 17:37:45 -0800 +Subject: [PATCH 20/54] Smack: File receive audit correction + +Eric Paris politely points out: + + Inside smack_file_receive() it seems like you are initting the audit + field with LSM_AUDIT_DATA_TASK. And then use + smk_ad_setfield_u_fs_path(). + + Seems like LSM_AUDIT_DATA_PATH would make more sense. (and depending + on how it's used fix a crash...) + +He is correct. This puts things in order. + +Targeted for git://git.gitorious.org/smack-next/kernel.git + +Signed-off-by: Casey Schaufler +--- + security/smack/smack_lsm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/security/smack/smack_lsm.c b/security/smack/smack_lsm.c +index d552832..d814e35 100644 +--- a/security/smack/smack_lsm.c ++++ b/security/smack/smack_lsm.c +@@ -1351,7 +1351,7 @@ static int smack_file_receive(struct file *file) + int may = 0; + struct smk_audit_info ad; + +- smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_TASK); ++ smk_ad_init(&ad, __func__, LSM_AUDIT_DATA_PATH); + smk_ad_setfield_u_fs_path(&ad, file->f_path); + /* + * This code relies on bitmasks. +-- +2.1.4 + -- cgit 1.2.3-korg