Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp2566lqs; Mon, 4 Mar 2024 12:58:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUtKXV+noJo9/h3GMbpcni3dgELDSHrp7Lo1K84xBUpSZNNs2SWkPXWsNPg7SAz83aAY+HoM3KsHDy52KF/8r6akqybgI55veuXetsYjw== X-Google-Smtp-Source: AGHT+IF8974y0sRwqoC6qb3lkv/mRqamiUFiOyfVASJI8Gz4kq8sZl4cNyN55KFf8uXYhvjZXE9c X-Received: by 2002:a17:906:f355:b0:a3e:c738:afa2 with SMTP id hg21-20020a170906f35500b00a3ec738afa2mr7532376ejb.76.1709585908369; Mon, 04 Mar 2024 12:58:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709585908; cv=pass; d=google.com; s=arc-20160816; b=IeX5U6bBdA+OjBCQN/1Z4sMTdchKKAFX7WPhEh1fGUJMqFPTyGdTauX32wEzheuWAk jmPZwYLEQZyNnBrsC3RQPzy1bOW0GEwqOUWOI5Bpf5W5C2UvrBywyKdVi0N1JwygpeFu aFFVFfiqPnpaif4YGQO3FUcKEF3B4fX7qWYxIZ/KnDzFikl8ORPG0g5pkHCNr5csuzS1 74lJtEvjxswdrgCasJXWbn8aui4h4BZ8eD4jGiZU4EeKJ6MjqPA1zXBULiA97JYq6iEQ 3kDTbJiefSdtsu4SK/J02XoolPORWfnUHNscMn7esUob8goRsBJyvcX7FovlryVWEKZo uJFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=MBysldzXTflPzomKWRmSMXhF54SNqFAu7g8kqMxzJW8=; fh=WcjVFjrwobjLfcTEstsjLjBITTmNjQiYApE2sHrPqE0=; b=JEfi0RA51nAxLuXJM//6XYg74A8/ppy4tbU79WxiSyLM0fNRs3qeJApKIboGDVOHxI 0TX3ey9z4armxvhdiN/idkI285JBmYomoGk9O0G3z5nPA6anORmHBaRyjUPm5ngfE/Dk FQH1TB3lt+yk0SzXJxG8/L3kVtdRb1K2Z5A727IoeoSYYsoyOdv50iRe5ujrxRd1yxZ+ prP//eHMOnyypi2Kme71QcpE6oYp1ta26dGcCkvX+BYh1Qn+VZ5KnIo+ZWeylfxNXnt8 nf8n/Zd5VTvH+ZbzWF6lnDo9xkOpqs0M95zmPDcLfSrao90TAe+1R6PZvMMedIixQ5R7 cl8g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JTg4ctT2; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-91265-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91265-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id cd19-20020a170906b35300b00a3e82ec0d72si4357503ejb.3.2024.03.04.12.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 12:58:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91265-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JTg4ctT2; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-91265-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91265-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1F6F21F265A3 for ; Mon, 4 Mar 2024 20:58:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1768410A2B; Mon, 4 Mar 2024 20:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JTg4ctT2" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB1BA1079D for ; Mon, 4 Mar 2024 20:58:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709585899; cv=none; b=Jaeiyd2KaWIPrTK8wk0TP+OUT+BsMAa52g5fyV6mr3ndmwLKwGK7CCcAdJo4rjUosPKgRkSh5nm1BjFKN0mloWcgvB35YFan6PUVlzPC787pICfxIWcQDI8fyCmT8ses2Zj/DGEDY2MmeKs67ry3W25NWLGC1TQT+iuCm3ewrVU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709585899; c=relaxed/simple; bh=vdK6RiW/KweEb9A7JW6V9Ozhw2b+gLO9iT+16Hcypr8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uqsjxq54yeFT0r9w+5mhYfQdIm/0ZyYJujIW6/SjvgykmH0DctE1YfX0K+fbl5o+I2GrKkSv06cvU+aMsLJq51YWMAFzj6tTdSH8SbiCAJLmPg4V5p3AYQbycsKZqpRrEjXOVcgP8Mkpkh/J96sPRcIB4emJh8ZUgzTSIasgQgY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JTg4ctT2; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1dc09556599so46961075ad.1 for ; Mon, 04 Mar 2024 12:58:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1709585897; x=1710190697; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=MBysldzXTflPzomKWRmSMXhF54SNqFAu7g8kqMxzJW8=; b=JTg4ctT2hzSBE5HZLwwuwqL52LNpw/pz84iJ+Lm9UnxvXgd8xleoD04qL6ScUAL+gG xFETjvJwH1BYAHdMKxxFr7r3hpwUrdz0r85KnBrBJZXSzfqiBY5nKIMH+scCd9ZirZAb /+qvENFgdlvIJ1apQ6VXW7x+15GNuzAhR/tAA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709585897; x=1710190697; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=MBysldzXTflPzomKWRmSMXhF54SNqFAu7g8kqMxzJW8=; b=s5TfJeAHIsjpPPDUsGbh/FNKkqR3lspbVSJE3CfNAXqSy30eL3pVtBVa47XBs5ndk8 BC6lhWL5vGw6wGS3SsfGCpBlyCeO+kj09qYAQDTGtC1I9oK6Zqi/tT/W8SP6Hi/5oUwR mtDyesmPgs0vPxNWnNGAXSpAC7uqtteoY5ue8VapoQJRtUnFZJqW1v1xEU6Fx0vavEZv tSH97mwMmfv83GQRaV7CxsZ3MsGeVlcMEctgCVv+ZekMbOKxbNjT4HCv7JGnpYhljy3b bKDOSWiK5JlQ9bVIA9Z+niFrXiTlIMZYHnWztPuuZgB9HRPaiVg/lWuQMYKYNCvZ1Mwj hSKA== X-Forwarded-Encrypted: i=1; AJvYcCXGj1cad1OGWDOA9a8U0CSrOfIOAEWqGjBF3pBb4ohlDaAM1Baj1v/ZTTDpgZOKHVdkernjyDQkEdHy0d6AXKnlISYxnOe/UAjE116i X-Gm-Message-State: AOJu0YxwyVAkzAynThRD3vG8oseLMv8HIatm+5sVCl8jSKYOMnaefPnc AhZ0+wdTu0Axq0rhKVh+E8bMTGJTLghIY0x7ykP+TFKoKzzI3RmnPr4LjHH4MQ== X-Received: by 2002:a17:902:a3cc:b0:1dc:794e:27b2 with SMTP id q12-20020a170902a3cc00b001dc794e27b2mr10676858plb.56.1709585897109; Mon, 04 Mar 2024 12:58:17 -0800 (PST) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id jv11-20020a170903058b00b001dc96c5fa13sm8950726plb.295.2024.03.04.12.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 12:58:16 -0800 (PST) Date: Mon, 4 Mar 2024 12:58:15 -0800 From: Kees Cook To: Muhammad Usama Anjum Cc: Eric Biederman , Shuah Khan , kernel@collabora.com, kernel-janitors@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/3] selftest/exec: conform test to TAP format output Message-ID: <202403041256.80EDE9BA2@keescook> References: <20240304155928.1818928-1-usama.anjum@collabora.com> <20240304155928.1818928-2-usama.anjum@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240304155928.1818928-2-usama.anjum@collabora.com> On Mon, Mar 04, 2024 at 08:59:24PM +0500, Muhammad Usama Anjum wrote: > Conform the layout, informational and status messages to TAP. No > functional change is intended other than the layout of output messages. > > Signed-off-by: Muhammad Usama Anjum > --- > tools/testing/selftests/exec/load_address.c | 34 +++++++++------------ > 1 file changed, 15 insertions(+), 19 deletions(-) > > diff --git a/tools/testing/selftests/exec/load_address.c b/tools/testing/selftests/exec/load_address.c > index d487c2f6a6150..17e3207d34ae7 100644 > --- a/tools/testing/selftests/exec/load_address.c > +++ b/tools/testing/selftests/exec/load_address.c > @@ -5,6 +5,7 @@ > #include > #include > #include > +#include "../kselftest.h" > > struct Statistics { > unsigned long long load_address; > @@ -41,28 +42,23 @@ int main(int argc, char **argv) > unsigned long long misalign; > int ret; > > + ksft_print_header(); > + ksft_set_plan(1); > + > ret = dl_iterate_phdr(ExtractStatistics, &extracted); > - if (ret != 1) { > - fprintf(stderr, "FAILED\n"); > - return 1; > - } > + if (ret != 1) > + ksft_exit_fail_msg("FAILED: dl_iterate_phdr\n"); I'm for this series, but I do note a weird glitch in the ksft API. ksft_exit_fail_msg does: va_start(args, msg); printf("Bail out! "); errno = saved_errno; vprintf(msg, args); va_end(args); "Bail out!" is not very descriptive. I think I'd rather this should be: "FAILED: " and then that added prefix doesn't need to be added everywhere in this patch, nor the "error: " prefix in the next patch. -- Kees Cook