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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171123010053.2398-1-jakub.kicinski@netronome.com>
Date:   Wed, 22 Nov 2017 17:00:53 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     netdev@...r.kernel.org
Cc:     oss-drivers@...ronome.com, daniel@...earbox.net,
        Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH iproute2/master] bpf: initialize the verifier log

If program loading fails before verifier prints its first
message, the verifier log will not be initialized.  Always
set the first character of the log buffer to zero to make
sure we don't dump non-printable characters to the terminal.

Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@...ronome.com>
---
 lib/bpf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bpf.c b/lib/bpf.c
index 10ea23a471ef..fdc28772fb71 100644
--- a/lib/bpf.c
+++ b/lib/bpf.c
@@ -1153,7 +1153,7 @@ static int bpf_log_realloc(struct bpf_elf_ctx *ctx)
 {
 	const size_t log_max = UINT_MAX >> 8;
 	size_t log_size = ctx->log_size;
-	void *ptr;
+	char *ptr;
 
 	if (!ctx->log) {
 		log_size = 65536;
@@ -1169,6 +1169,7 @@ static int bpf_log_realloc(struct bpf_elf_ctx *ctx)
 	if (!ptr)
 		return -ENOMEM;
 
+	ptr[0] = 0;
 	ctx->log = ptr;
 	ctx->log_size = log_size;
 
-- 
2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ