From patchwork Fri Jun 26 13:05:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11627577 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7038713B4 for ; Fri, 26 Jun 2020 13:08:08 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0C3722081A for ; Fri, 26 Jun 2020 13:08:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BCKVaGZK"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hjeADPj+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C3722081A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8w6mIVPNfmnXT+qeEsTy5T0Z1xB2b8tinY/SoXSVkXI=; b=BCKVaGZKU+OXkwn2bOQVXrGdG 9+ILB0JreHqklNDjnMA/8zQu7IMXUfm7xuAZnwDvyVeCEFBAd9Havt6A8a6nnjjCfuVpVMb8YSfKJ uCyqykI3eReRIaVr55UJDPALhrTOGZO7EH+fFoKAkydazMHy9snikqnbU38YkKVcK4LEPK2Zo4o+w zuHn+Tez+eZQJVmTt5ojG2u5905MRSzIF+WJKq6/nUi7kJ3ChNMTki5yladSzgMx1inIq7BxbeLu5 hzV8ai/q56ReLA0ik/ulx2pWZzNoOa5lsYksdeAkdvKfLzy1VnvTOsF6BUqc3cWPF4GfPJUVKtzC3 xYXpnsyKw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joo3I-0002m5-Nc; Fri, 26 Jun 2020 13:05:56 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joo2w-0002gi-TK for linux-arm-kernel@lists.infradead.org; Fri, 26 Jun 2020 13:05:36 +0000 Received: by mail-wr1-x443.google.com with SMTP id b6so9419817wrs.11 for ; Fri, 26 Jun 2020 06:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GAj330t/cLz/0OA5LR4Jx3FFMEjm0vNa388Rc6BW4E8=; b=hjeADPj+J8vNOwmitxg9Sq/bkOGvPZqy5wI5dY78aKilYPQ34vfHpdzTNNXwUUda7a TeAh0Vy3PKN3+5oOUCy3GnILWKVTXX9wvt8Qq4rF8ic9I5U4XegFPlEsffv2Yi3lcvi8 BdfZNJkUPRKfF5m/DikKLMAd024eQ2QQSLb/Y8B+XcAnnAz7sI6aA9iT7b3kQWFE2aLQ IKEIVVaGH7mRmTnXSqC5d92uZuiVUJrtmwRDZyHMD/fvC4IJDyEFdXf1FGu4vNKPvT+K qBgMz360dqdXTLJNuZzZ+bk/WGh+WGtTly/yXu6npw/+hb+xylgPxq2jL9GqPpBfesdb 285w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GAj330t/cLz/0OA5LR4Jx3FFMEjm0vNa388Rc6BW4E8=; b=cBZbVBQTQ4RVZBp22Fr6Is0TijAveDxsQG3JBF60jPpl7etWt1lHYUEYepapvKJqkP 07CpHtqz3A41o/WIyqRfwAjFU3QzzgxAcF7xdXP2DIJNwTVz+PTLOwq8owLkqef7YvQ3 +g5LpTVy/O90TBwg5UgBvsxxQTwI3wkmOoD2FqrJKSZ0wPUhk6pIaUSMwD9u9pL1R3Md XgjF4gcHHHaoC+dwROfVxQtZmSXJ9CdkanYW2O7HYK+iRuNgSBRLB8rdm3qfMNzMXNCl +eUI1WhTlmqA1nNm8SZ2fKfaqlr/shwhxJUBdqR7fQ3dWpQ5bJ+8iw8DQg8fdmy10233 vVzg== X-Gm-Message-State: AOAM533Of4FLx3qnE/ggVeKT/jL40Gca5TT1CJs9Ewg6x8FTHdsfV7po 7wxOFP9inhh4Qde7UPDWEl//7w== X-Google-Smtp-Source: ABdhPJz0Z/3IvuQkcNWe4kc7SPhrizHq3K94NdYdMbd/faRkSyqVl19ju6hkKCpPo/dFz1MB0suI5A== X-Received: by 2002:adf:9148:: with SMTP id j66mr1872622wrj.311.1593176733769; Fri, 26 Jun 2020 06:05:33 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id u20sm16746904wmc.44.2020.06.26.06.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 06:05:32 -0700 (PDT) From: Lee Jones To: arnd@arndb.de, gregkh@linuxfoundation.org Subject: [PATCH 04/10] misc: lkdtm: bugs: At least try to use popuated variable Date: Fri, 26 Jun 2020 14:05:19 +0100 Message-Id: <20200626130525.389469-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200626130525.389469-1-lee.jones@linaro.org> References: <20200626130525.389469-1-lee.jones@linaro.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Kees Cook Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The result may not be intereresting, but not using a set variable is bad form and causes W=1 kernel builds to complain. Fixes the following W=1 warning(s): drivers/misc/lkdtm/bugs.c: In function ‘lkdtm_STACK_GUARD_PAGE_LEADING’: drivers/misc/lkdtm/bugs.c:331:25: warning: variable ‘byte’ set but not used [-Wunused-but-set-variable] 331 | volatile unsigned char byte; | ^~~~ drivers/misc/lkdtm/bugs.c: In function ‘lkdtm_STACK_GUARD_PAGE_TRAILING’: drivers/misc/lkdtm/bugs.c:345:25: warning: variable ‘byte’ set but not used [-Wunused-but-set-variable] 345 | volatile unsigned char byte; | ^~~~ Cc: Kees Cook Signed-off-by: Lee Jones Acked-by: Kees Cook --- drivers/misc/lkdtm/bugs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/lkdtm/bugs.c b/drivers/misc/lkdtm/bugs.c index 736675f0a2464..4f94296fc58ad 100644 --- a/drivers/misc/lkdtm/bugs.c +++ b/drivers/misc/lkdtm/bugs.c @@ -334,7 +334,7 @@ void lkdtm_STACK_GUARD_PAGE_LEADING(void) byte = *ptr; - pr_err("FAIL: accessed page before stack!\n"); + pr_err("FAIL: accessed page before stack! (byte: %x)\n", byte); } /* Test that VMAP_STACK is actually allocating with a trailing guard page */ @@ -348,7 +348,7 @@ void lkdtm_STACK_GUARD_PAGE_TRAILING(void) byte = *ptr; - pr_err("FAIL: accessed page after stack!\n"); + pr_err("FAIL: accessed page after stack! (byte: %x)\n", byte); } void lkdtm_UNSET_SMEP(void)