lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 20 Dec 2017 11:15:44 +0800
From:   Chen Rong <chenr.fnst@...fujitsu.com>
To:     unlisted-recipients:; (no To-header on input)
CC:     <chenr.fnst@...fujitsu.com>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Shuah Khan <shuah@...nel.org>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linux-kselftest@...r.kernel.org>
Subject: [PATCH] selftests/bpf: remove the DEBUG macro for test_dev_cgroup

The test may fail if not enable DEBUG macro in dev_cgroup.c
  # ./test_dev_cgroup
  libbpf: load bpf program failed: Operation not permitted
  libbpf: failed to load program 'cgroup/dev'
  libbpf: failed to load object './dev_cgroup.o'
  Failed to load DEV_CGROUP program

Removing the DEBUG macro makes the test always pass.

Signed-off-by: Chen Rong <chenr.fnst@...fujitsu.com>
---
 tools/testing/selftests/bpf/dev_cgroup.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/dev_cgroup.c b/tools/testing/selftests/bpf/dev_cgroup.c
index ce41a34..a167c6d 100644
--- a/tools/testing/selftests/bpf/dev_cgroup.c
+++ b/tools/testing/selftests/bpf/dev_cgroup.c
@@ -13,7 +13,6 @@ SEC("cgroup/dev")
 int bpf_prog1(struct bpf_cgroup_dev_ctx *ctx)
 {
 	short type = ctx->access_type & 0xFFFF;
-#ifdef DEBUG
 	short access = ctx->access_type >> 16;
 	char fmt[] = "  %d:%d    \n";
 
@@ -39,7 +38,6 @@ int bpf_prog1(struct bpf_cgroup_dev_ctx *ctx)
 		fmt[10] = 'm';
 
 	bpf_trace_printk(fmt, sizeof(fmt), ctx->major, ctx->minor);
-#endif
 
 	/* Allow access to /dev/zero and /dev/random.
 	 * Forbid everything else.
-- 
2.5.0



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ