summaryrefslogtreecommitdiffstats
path: root/samples/seccomp/bpf-fancy.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2015-02-17 13:47:58 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 14:34:55 -0800
commit3a9af0bd34410a255d27024ea1bc28dc4e3a0044 (patch)
treefc248a3d7edb3e0ef323c9352f6467a476a86b01 /samples/seccomp/bpf-fancy.c
parent52644c9ab3faefbfbf07a19c24c4e74e33cfd796 (diff)
downloadtalos-op-linux-3a9af0bd34410a255d27024ea1bc28dc4e3a0044.tar.gz
talos-op-linux-3a9af0bd34410a255d27024ea1bc28dc4e3a0044.zip
samples/seccomp: improve label helper
Fixes a potential corruption with uninitialized stack memory in the seccomp BPF sample program. [akpm@linux-foundation.org: coding-style fixlet] Signed-off-by: Kees Cook <keescook@chromium.org> Reported-by: Robert Swiecki <swiecki@google.com> Tested-by: Robert Swiecki <swiecki@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'samples/seccomp/bpf-fancy.c')
-rw-r--r--samples/seccomp/bpf-fancy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/seccomp/bpf-fancy.c b/samples/seccomp/bpf-fancy.c
index 8eb483aaec46..e8b24f443709 100644
--- a/samples/seccomp/bpf-fancy.c
+++ b/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];
OpenPOWER on IntegriCloud