[pve-devel] [PATCH v2 kernel 3/3] import another apparmor followup patch

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Jul 12 10:31:15 CEST 2016


---
 Makefile                                            |  1 +
 ...mputation-for-when-setprocattr-is-null-ter.patch | 21 +++++++++++++++++++++
 2 files changed, 22 insertions(+)
 create mode 100644 apparmor-fix-arg_size-computation-for-when-setprocattr-is-null-ter.patch

diff --git a/Makefile b/Makefile
index 1496d37..912c507 100644
--- a/Makefile
+++ b/Makefile
@@ -256,6 +256,7 @@ ${KERNEL_SRC}/README ${KERNEL_CFG_ORG}: ${KERNELSRCTAR}
 	cd ${KERNEL_SRC}; patch -p1 < ../981-2-PCI-Quirk-PCH-root-port-ACS-for-Sunrise-Point.patch
 	cd ${KERNEL_SRC}; patch -p1 < ../kvm-dynamic-halt-polling-disable-default.patch
 	cd ${KERNEL_SRC}; patch -p1 < ../CVE-2016-6187-apparmor-fix-oops-validate-buffer-size-in-apparmor_s.patch
+	cd ${KERNEL_SRC}; patch -p1 < ../apparmor-fix-arg_size-computation-for-when-setprocattr-is-null-ter.patch
 	sed -i ${KERNEL_SRC}/Makefile -e 's/^EXTRAVERSION.*$$/EXTRAVERSION=${EXTRAVERSION}/'
 	touch $@
 
diff --git a/apparmor-fix-arg_size-computation-for-when-setprocattr-is-null-ter.patch b/apparmor-fix-arg_size-computation-for-when-setprocattr-is-null-ter.patch
new file mode 100644
index 0000000..857af92
--- /dev/null
+++ b/apparmor-fix-arg_size-computation-for-when-setprocattr-is-null-ter.patch
@@ -0,0 +1,21 @@
+commit e88e6cc9148ce0ff250dc2c6265fa8c30ffc6d8d
+Author: John Johansen <john.johansen at canonical.com>
+Date:   Sat Jul 9 23:46:33 2016 -0700
+
+    apparmor: fix arg_size computation for when setprocattr is null terminated
+    
+    Signed-off-by: John Johansen <john.johansen at canonical.com>
+
+diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
+index c6921a0..3be30c7 100644
+--- a/security/apparmor/lsm.c
++++ b/security/apparmor/lsm.c
+@@ -529,7 +529,7 @@ static int apparmor_setprocattr(struct task_struct *task, char *name,
+ 	if (!*args)
+ 		goto out;
+ 
+-	arg_size = size - (args - (char *) value);
++	arg_size = size - (args - (largs ? largs : (char *) value));
+ 	if (strcmp(name, "current") == 0) {
+ 		if (strcmp(command, "changehat") == 0) {
+ 			error = aa_setprocattr_changehat(args, arg_size,
-- 
2.1.4





More information about the pve-devel mailing list