From patchwork Tue Nov 27 03:12:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Rue X-Patchwork-Id: 152104 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp736727ljp; Mon, 26 Nov 2018 19:13:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/UC8k+GPVxGbtVGFIy7rbJEVXQBZgjgxjE5Vhx4DdkA1phkBKgd0XEmHAZAgJqN82A0zrLc X-Received: by 2002:a63:4d:: with SMTP id 74mr28322232pga.248.1543288379850; Mon, 26 Nov 2018 19:12:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543288379; cv=none; d=google.com; s=arc-20160816; b=GLbUUNq7WuUPnV8wnP/48IkyjMTeOwksG0orZmOIZFR+xX7Z89qSTJs7P3zCgUJrHd gc3LDs/TTRp3ayzLj8IwL7pChv5cumA5m7Uk+WB1bLC2jLTqvhPzYUnu3T2mWbykOZjU AM2G5gGrZ0dsJhiunS7QgUYX8QCG3GGktcId4rkQ4hOu8ec6R7kk/NEbVNWOsvBCBrwz w4JmB/nQE4mP6v6DL6bT64upb4ioh2y3xIC9KTiwcXMvLfYjXMUl1hVCCW5mSTtjQqOA 9v0XxJW1kXWj+151EdJSSveLavTS1ABluGxC6qGttimY9pl8KeLwyxuErvVmdjgTUsi9 EwRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wGt0nwknXf8js5Tv9n0b8MS3AqmG0XFqvIR4lkoqZTw=; b=ww2z9ju6mrZ51MU745kTad4mzDwQqHna8N1Gur0va1+PV4lsxIK+HtFO88nPNYcfLi 6CO6+ZgX1/GU1szGZW/I3Y/MWWlIgZHFcoV8gWfW1cqz8sMrCUqoj6oeGSQIwpik1rXp IoA3hyMLWUB0My6U0CJRqdqSg/rp/tAr7WxGfrHAcbZujul6k0p8uQTi5aKK72cz3rw5 s8+3BrlwPes/T3nYVeJYfvGF76Lb6muTfRhQqscqsCtUqf4w2YnKvbMa43YTtKaxKueY AlTxDBCzoWz8v4yBG2RFmjDid2TvdZ7VQLyHJW87qUXwJcsvwpjtCOL9moUxEr9zgxLb 372w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QCWWrozD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6-v6si2412346plt.328.2018.11.26.19.12.59; Mon, 26 Nov 2018 19:12:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QCWWrozD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728510AbeK0OJV (ORCPT + 32 others); Tue, 27 Nov 2018 09:09:21 -0500 Received: from mail-io1-f50.google.com ([209.85.166.50]:46452 "EHLO mail-io1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728431AbeK0OJU (ORCPT ); Tue, 27 Nov 2018 09:09:20 -0500 Received: by mail-io1-f50.google.com with SMTP id v10so10145294ios.13 for ; Mon, 26 Nov 2018 19:12:57 -0800 (PST) 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=wGt0nwknXf8js5Tv9n0b8MS3AqmG0XFqvIR4lkoqZTw=; b=QCWWrozDLm9AGnpjiOXGa4PFMJN2Pf/cim+RMMzNvMJ6syz7bMXCxXmB1XpvnddaUo 1lqSL6yjBjp4deDVpxQ1qlTg7UY+QRMefZozjSETvA/H41P2GdddstjILPBPbkYrabJn IICVT3FKOS8AGAsa8nCYLIovyU2tcPKNOJmlw= 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=wGt0nwknXf8js5Tv9n0b8MS3AqmG0XFqvIR4lkoqZTw=; b=AKqrTvK9EMaXJkEXtsL5SZBxCIOKSbQaesLGjvReQu+nBlyKy0Qc50v1E34jgNdsrx lUoPbYnadm0mRK8ooM7jMMUpNfIKgc16ZTJwHFVgssc4ODHHSS0ijXgMyzDyX7kth1vM T+xNQoCqIRdy4m//5t/JFw1cR5wY3hRsuoTcucHw6nO88buxQMAtoEC5XDm+ZiPL0uFX G7Gs/mQrT2Cl5+MH/NZmJzFNP4bitM5vxnIVqnxnuJgpF7U3GqKoPB+0suEmkNhX3fdM PYb5d+f/ZvPxno3yAktfjlPQoIipgqqJpNSPhGZLm71k4Ud7PRHxbSARSEalZclIzcES 5Eag== X-Gm-Message-State: AA+aEWY3T+V81ugy1HfK+yTKYbKKbyewQEWypKcCm+yGPGUZYQDC7yRu Uei+YU5tumjHePnF7cF+fEF8sCh3sKA= X-Received: by 2002:a5d:8b8d:: with SMTP id p13mr16027638iol.223.1543288376162; Mon, 26 Nov 2018 19:12:56 -0800 (PST) Received: from localhost (c-107-2-67-121.hsd1.mn.comcast.net. [107.2.67.121]) by smtp.gmail.com with ESMTPSA id w186sm1149449itb.15.2018.11.26.19.12.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 19:12:55 -0800 (PST) From: Dan Rue To: linux-kernel@vger.kernel.org Cc: Dan Rue , Shuah Khan , Greg Kroah-Hartman , Kees Cook , "Luis R. Rodriguez" , linux-kselftest@vger.kernel.org Subject: [PATCH 1/2] selftests: firmware: remove use of non-standard diff -Z option Date: Mon, 26 Nov 2018 21:12:15 -0600 Message-Id: <20181127031218.24419-2-dan.rue@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181127031218.24419-1-dan.rue@linaro.org> References: <20181127031218.24419-1-dan.rue@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -- 2.19.1 Acked-by: Kees Cook diff -Z is used to trim the trailing whitespace when comparing the loaded firmware file with the source firmware file. However, per the comment in the source code, -Z should not be necessary. In testing, the input and output files are identical. Additionally, -Z is not a standard option and is not available in environments such as busybox. When -Z is not supported, diff fails with a usage error, which is suppressed, but then causes read_firmwares() to exit with a false failure message. Signed-off-by: Dan Rue --- tools/testing/selftests/firmware/fw_filesystem.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/firmware/fw_filesystem.sh b/tools/testing/selftests/firmware/fw_filesystem.sh index a4320c4b44dc..466cf2f91ba0 100755 --- a/tools/testing/selftests/firmware/fw_filesystem.sh +++ b/tools/testing/selftests/firmware/fw_filesystem.sh @@ -155,11 +155,8 @@ read_firmwares() { for i in $(seq 0 3); do config_set_read_fw_idx $i - # Verify the contents are what we expect. - # -Z required for now -- check for yourself, md5sum - # on $FW and DIR/read_firmware will yield the same. Even - # cmp agrees, so something is off. - if ! diff -q -Z "$FW" $DIR/read_firmware 2>/dev/null ; then + # Verify the contents match + if ! diff -q "$FW" $DIR/read_firmware 2>/dev/null ; then echo "request #$i: firmware was not loaded" >&2 exit 1 fi @@ -171,7 +168,7 @@ read_firmwares_expect_nofile() for i in $(seq 0 3); do config_set_read_fw_idx $i # Ensures contents differ - if diff -q -Z "$FW" $DIR/read_firmware 2>/dev/null ; then + if diff -q "$FW" $DIR/read_firmware 2>/dev/null ; then echo "request $i: file was not expected to match" >&2 exit 1 fi From patchwork Tue Nov 27 03:12:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Rue X-Patchwork-Id: 152105 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp736779ljp; Mon, 26 Nov 2018 19:13:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/VhV8SANA9AervNyv+wpL2jGR7RKq9UmCUzzsabJztiB3Ss6BLmMXKwMv7r1SI4CyInmoND X-Received: by 2002:a62:a209:: with SMTP id m9mr5033853pff.218.1543288383494; Mon, 26 Nov 2018 19:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543288383; cv=none; d=google.com; s=arc-20160816; b=BZLppAJcqy2jh2gE49IaY8ZgScNXPbNCFyPWdg88+TIfSoPu3jIO6D6AZ/iHksNkd0 HayEe3Vu4Xr7VLfM3+hQSfoPb0CUocQD+YTjNdDjyoo37RRIlBNW+zYeF5fsFHEAzskY ioAaF6v/tiHGErcv/av+90GNIdes/9hwByQA+eMSU71+qJAq8R3y2mjyBKLCaL0BMMBB Ha5fGOAsfFBfuiViy1Vy4QeQeT13VeYYi41pQVmzLTb9tY9ivAPv6DXPNzbpw3omBEKf w+26hwqjNswhd6UW4OYx4Ny5lPjx9x9gBEJsWDMz9tN8KhzTkf0Z84H3LeE78P/ZMSRQ UQWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UNR7WQBsg6SMTrLbOHn0u1gL1Kd8gB6JnhT0P9RIk0s=; b=RlRqinIAm3+ZXbE7XXPnLZF47Ha9g5h73959OtG7wJQiQZGcYPM2hZb8pvgnwtlmUa 7hkFCTUvUyXMc/QSn314rQc6F1ySb1sJXQTARsmQF477gURn+lTCCJFXNO/9dlSMnzjO n24dtj6QLA6lGQV9wTlXH8zTcGU447F1WLes0Uk49UQxdO0HgqlaTKfg9bS9YKYT+1/B 52YVgw4if2oCv0eFPEthXOzk4vZN0YTsChccwvsfl8pGBJ4mPfQdK1oIQD7SxQRDSK99 9OTaUYa3dJCnL0CZKQfs6umXIYHuzF+/GTZiHO6zmANMnagvMQ+lbl8VEcnZ48ppktYP 23Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WNgHNzlu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x187si2494058pgx.241.2018.11.26.19.13.03; Mon, 26 Nov 2018 19:13:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WNgHNzlu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728526AbeK0OJY (ORCPT + 32 others); Tue, 27 Nov 2018 09:09:24 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:54990 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbeK0OJY (ORCPT ); Tue, 27 Nov 2018 09:09:24 -0500 Received: by mail-it1-f194.google.com with SMTP id m123-v6so7784598ita.4 for ; Mon, 26 Nov 2018 19:13:01 -0800 (PST) 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=UNR7WQBsg6SMTrLbOHn0u1gL1Kd8gB6JnhT0P9RIk0s=; b=WNgHNzlu1vfMPm0OjpQTZzSHm8jb2ftPDjxJvmhhJzhhDOEqr+8o6gkRUMrsGp0WFZ x47aB00bfNqoTjF4WBMBXnXqHiWnDwsnN/rTUQiFEoBAxv1c3WOxafqNMJDwFqKzRjfU 1h7AuRGZQVJW4tkfScQVfarboCg3f5uK5BZuk= 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=UNR7WQBsg6SMTrLbOHn0u1gL1Kd8gB6JnhT0P9RIk0s=; b=SssJs/VhpP90OtKXwgM6fICUUk1uU8k/Eke/ldiNHQhxJbOQ2i5nFOy+I3XmGKx8Tn x9tbDmygdXpDLvCmbvk6Ah6d/mPTAEOHJmKQmfEFh1w5I/JRtUm5TrbZ16LarIm6MdhF Df6aS6D7P8TkIRhZZG4EZejD3uWcQYJCob1+F1tcok4mSynon8OWNUUUf0hFbTdxnYIq cfQ2/5tqCYfV/575cMek7z5PgFQYItyP97gdetymBmZhBA/a3jZHwq+/vkg4Oh9B9DzW 75Zd4YhFVB0+QNF2gNy7Qfn/k8bRgqoH4pyAZ4Qc7XPYNlTFlDFNXjcS60RbBmsNkZ5e ONyw== X-Gm-Message-State: AA+aEWbPTk6nbSOUZ1j7MDleH1cqPd53HwWTuytpV9DK5ba8hTUP+c86 yklFdgPMhvUqAfh6uDKAAzQ668l4pZ0= X-Received: by 2002:a24:d60a:: with SMTP id o10mr23558527itg.162.1543288380352; Mon, 26 Nov 2018 19:13:00 -0800 (PST) Received: from localhost (c-107-2-67-121.hsd1.mn.comcast.net. [107.2.67.121]) by smtp.gmail.com with ESMTPSA id w16sm1775480ita.38.2018.11.26.19.12.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Nov 2018 19:12:59 -0800 (PST) From: Dan Rue To: linux-kernel@vger.kernel.org Cc: Dan Rue , Shuah Khan , "Luis R. Rodriguez" , Greg Kroah-Hartman , Kees Cook , linux-kselftest@vger.kernel.org Subject: [PATCH 2/2] selftests: firmware: add CONFIG_FW_LOADER_USER_HELPER_FALLBACK to config Date: Mon, 26 Nov 2018 21:12:16 -0600 Message-Id: <20181127031218.24419-3-dan.rue@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181127031218.24419-1-dan.rue@linaro.org> References: <20181127031218.24419-1-dan.rue@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y is required for fw_fallback.sh. Without it, fw_fallback.sh fails with 'usermode helper disabled so ignoring test'. Enable the config in selftest so that it gets built by default. Signed-off-by: Dan Rue --- tools/testing/selftests/firmware/config | 1 + 1 file changed, 1 insertion(+) -- 2.19.1 Acked-by: Kees Cook diff --git a/tools/testing/selftests/firmware/config b/tools/testing/selftests/firmware/config index bf634dda0720..913a25a4a32b 100644 --- a/tools/testing/selftests/firmware/config +++ b/tools/testing/selftests/firmware/config @@ -1,5 +1,6 @@ CONFIG_TEST_FIRMWARE=y CONFIG_FW_LOADER=y CONFIG_FW_LOADER_USER_HELPER=y +CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y