Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1917153img; Wed, 27 Feb 2019 07:36:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IasVmjEZImLAPlVF/lUjReZkb0htlbT2GE8RlFuSyd/krcJhChLN89tJ6j7PAy+GSCshMKm X-Received: by 2002:a62:569b:: with SMTP id h27mr2192481pfj.163.1551281762450; Wed, 27 Feb 2019 07:36:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551281762; cv=none; d=google.com; s=arc-20160816; b=PjB/p/F7F/6NKOwcqjxRlTAk4hLRtOsQhCRdfTgnaUhMN5qFMYVYlH4Sctaq+0gB57 df0o7QrgRvfZWUlJPp0mjGmr94T/dsiAhX0nfROuOjQCwuonkhfIKugswHVdrVB4LN9v ltxQSbjGWxmBOMiaxlHV2sXfRBoOK/xFvE8VV9wXZ2t5HC67BpT3fkkuyhYoGopNKGwz PhojIM0eTRNAZqg3vy7VdlY4GZt9t/Ny5kw0AUs5TO86qmsUvdUTyz/bBQ4MzjZQWi0b h/TqdUACjGobWf5UEywa5VIWtA3DZyFnSF8RAq7b9yXqglyPrQyKzwTKXM0v7cNba7D2 KpCw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2bfTbomuhxBEc5Imsi5zXCnbpiQQ6uhXCW/VbHBIs/g=; b=d6lpecYim3bk2ObvIqqMLr+QpzReBK00N9gcjdbiXPsA9h46NJrLGNR44vyf2uHqCe i4RMQxN9Nseugep0N4cK/ABIgcVGOdv/yUd0rNSoPm/D4poXkxC/PqdYkLYH7Aqk7vvS mVkSHezoOUVMAUDOAMsBmLTcfxnYonJpcb3g//y7FHJlf3JvES3GHPNHzMLwE4cVvd3I y5fdIK3VxFMmF9p8I8M/0YM+ydzWhtOFstqQD9kzDlfdQyB+QTB/0PupQ0ImPLRArYgQ R3bFVZ3zhM28cCJP08hQ9kjc1asCRw9vcBaKB4DFmddg3TjZ4HlZ8H543WvnGzuH2MOl 59tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mSiCQbt4; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w34si6673738pla.135.2019.02.27.07.35.46; Wed, 27 Feb 2019 07:36:02 -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=@kernel.org header.s=default header.b=mSiCQbt4; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730032AbfB0Pdz (ORCPT + 99 others); Wed, 27 Feb 2019 10:33:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:40158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726122AbfB0Pdz (ORCPT ); Wed, 27 Feb 2019 10:33:55 -0500 Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net [24.9.64.241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF30C20684; Wed, 27 Feb 2019 15:33:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551281634; bh=NlH7X5PsMh8aGpE/KrZDZDMxRw3svIQqQ9REU9W1rrs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=mSiCQbt422wPstYsAPx3uJgPjgUjVeuPQUwZ6FIW3wQwXl68Hxg7NfIyYMJO1KsqN MqlEgz3NlJ7j5cJJ3h2fN3rHdMmXz+Tqow1MmNH+VTkScyiJFhjrbzupUeH4C9p9zT xmZrYNkwpI9yo9X/yfTrZ3nyD6d2lT+kZ09mA8YA= Subject: Re: [PATCH v2 5/5] selftests/ima: loading kernel modules To: Mimi Zohar , linux-kselftest@vger.kernel.org Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, Petr Vorel , shuah References: <1551223620-11586-1-git-send-email-zohar@linux.ibm.com> <1551223620-11586-6-git-send-email-zohar@linux.ibm.com> <19d494c6-ecb1-b884-2d23-5f556b3ec05b@kernel.org> <1551276893.10911.23.camel@linux.ibm.com> From: shuah Message-ID: Date: Wed, 27 Feb 2019 08:33:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1551276893.10911.23.camel@linux.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mimi, On 2/27/19 7:14 AM, Mimi Zohar wrote: > Hi Shuah, > >>> diff --git a/tools/testing/selftests/ima/test_kernel_module.sh b/tools/testing/selftests/ima/test_kernel_module.sh >>> new file mode 100755 >>> index 000000000000..4009e1b60b03 >>> --- /dev/null >>> +++ b/tools/testing/selftests/ima/test_kernel_module.sh >>> @@ -0,0 +1,96 @@ >>> +#!/bin/sh >>> +# SPDX-License-Identifier: GPL-2.0-or-later >> >> Same here >> >> # SPDX-License-Identifier: GPL-2.0 > > Sure, I'll make the change here and in the other places. > > Thanks. >>> +get_secureboot_mode >>> +if [ $? -eq 0 ]; then >>> + log_skip "secure boot not enabled" >>> +fi >>> + >>> +# get the kernel config >>> +get_kconfig >>> + >> >> get_kconfig() will be good candidate as a kselftest common >> function. Is that possible? > > Sure, where would it go?  get_kconfig calls log_skip.  I didn't see > any common logging functions.  Petr suggested defining a set of common > logging functions.  Did you want to only make "log_skip" a common > function or the other logging functions log_pass, log_fail, log_info > as well? > We can do this as a separate effort in the interest of getting these in the interest of getting these in. We have common functions in ksefltest.h for c and we don't have them for tests scripts. We might be able to collect common routines such as get_kconfig into a common .sh and include in tests. If you have time to do this, that will be great. It can be done as a separate effort. thanks, -- Shuah