From patchwork Tue Aug 31 09:10:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Palethorpe X-Patchwork-Id: 1522499 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=susede1 header.b=c00mR2/M; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GzLxq6PFxz9s5R for ; Tue, 31 Aug 2021 19:10:23 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 56DFA3C4D5E for ; Tue, 31 Aug 2021 11:10:21 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by picard.linux.it (Postfix) with ESMTPS id 619D03C2A0B for ; Tue, 31 Aug 2021 11:10:19 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id D00B21A00162 for ; Tue, 31 Aug 2021 11:10:18 +0200 (CEST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 494232200C; Tue, 31 Aug 2021 09:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1630401018; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Jrcar/bR5Kxl1HxCeLU/dAGjaOyGWJfhcKqdwDo75Kk=; b=c00mR2/MIRehf3wb3GU4r0Fvyr9P5823F9Rq4n/26dgknIApYClw+gK5jl15cDT8N1DTz9 Lc390I7OjwH1o5uVj5yaQD/AG0VTYALbuz+SZQEZjblLIPynBOR0VZbiggHbOPhv9mwDU/ cYQ9alPP7/oxYwWqm+RLOSWIL1edwNg= Received: from g78.suse.de (unknown [10.163.24.38]) by relay2.suse.de (Postfix) with ESMTP id 0C6DAA3B98; Tue, 31 Aug 2021 09:10:18 +0000 (UTC) To: ltp@lists.linux.it Date: Tue, 31 Aug 2021 10:10:03 +0100 Message-Id: <20210831091005.25361-2-rpalethorpe@suse.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210831091005.25361-1-rpalethorpe@suse.com> References: <20210831091005.25361-1-rpalethorpe@suse.com> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.102.4 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH v2 2/4] bpf: Print full verification log X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Palethorpe via ltp From: Richard Palethorpe Reply-To: Richard Palethorpe Cc: Richard Palethorpe Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The log never falls within the 1024 byte limit imposed by format string buffer. So print it separately with dprintf. Signed-off-by: Richard Palethorpe --- testcases/kernel/syscalls/bpf/bpf_common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/bpf/bpf_common.c b/testcases/kernel/syscalls/bpf/bpf_common.c index ba0829a75..aac235cac 100644 --- a/testcases/kernel/syscalls/bpf/bpf_common.c +++ b/testcases/kernel/syscalls/bpf/bpf_common.c @@ -3,6 +3,8 @@ * Copyright (c) 2019-2020 Linux Test Project */ +#include + #define TST_NO_DEFAULT_MAIN #include "tst_test.h" #include "bpf_common.h" @@ -118,8 +120,10 @@ int bpf_load_prog(union bpf_attr *const attr, const char *const log) if (ret != -1) tst_brk(TBROK, "Invalid bpf() return value: %d", ret); - if (log[0] != 0) - tst_brk(TBROK | TERRNO, "Failed verification: %s", log); + if (log[0] != 0) { + tst_printf("%s\n", log); + tst_brk(TBROK | TERRNO, "Failed verification"); + } tst_brk(TBROK | TERRNO, "Failed to load program"); return ret;