+ samples-seccomp-improve-label-helper.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: samples/seccomp: improve label helper
has been added to the -mm tree.  Its filename is
     samples-seccomp-improve-label-helper.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/samples-seccomp-improve-label-helper.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/samples-seccomp-improve-label-helper.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Kees Cook <keescook@xxxxxxxxxxxx>
Subject: samples/seccomp: improve label helper

Fixes a potential corruption with uninitialized stack memory in the
seccomp BPF sample program.

Signed-off-by: Kees Cook <keescook@xxxxxxxxxxxx>
Reported-by: Robert Swiecki <swiecki@xxxxxxxxxx>
Tested-by: Robert Swiecki <swiecki@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 samples/seccomp/bpf-fancy.c  |    4 +++-
 samples/seccomp/bpf-helper.c |    5 +++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff -puN samples/seccomp/bpf-fancy.c~samples-seccomp-improve-label-helper samples/seccomp/bpf-fancy.c
--- a/samples/seccomp/bpf-fancy.c~samples-seccomp-improve-label-helper
+++ a/samples/seccomp/bpf-fancy.c
@@ -25,7 +25,9 @@
 
 int main(int argc, char **argv)
 {
-	struct bpf_labels l;
+	struct bpf_labels l = {
+		.count = 0,
+	};
 	static const char msg1[] = "Please type something: ";
 	static const char msg2[] = "You typed: ";
 	char buf[256];
diff -puN samples/seccomp/bpf-helper.c~samples-seccomp-improve-label-helper samples/seccomp/bpf-helper.c
--- a/samples/seccomp/bpf-helper.c~samples-seccomp-improve-label-helper
+++ a/samples/seccomp/bpf-helper.c
@@ -10,6 +10,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "bpf-helper.h"
@@ -63,6 +64,10 @@ __u32 seccomp_bpf_label(struct bpf_label
 {
 	struct __bpf_label *begin = labels->labels, *end;
 	int id;
+	if (labels->count == BPF_LABELS_MAX) {
+		fprintf(stderr, "Too many labels\n");
+		exit(1);
+	}
 	if (labels->count == 0) {
 		begin->label = label;
 		begin->location = 0xffffffff;
_

Patches currently in -mm which might be from keescook@xxxxxxxxxxxx are

docs-procs-describe-proc-pid-map_files-entry.patch
docs-procs-describe-proc-pid-map_files-entry-fix.patch
all-arches-signal-move-restart_block-to-struct-task_struct.patch
lib-vsprintf-add-%pt-format-specifier.patch
samples-seccomp-improve-label-helper.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux