Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp38445imm; Tue, 5 Jun 2018 14:36:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJAyT+keDZ3QTnuRs1OK9bOtMnH8y11RkyQnI6G7hK31R1r9AG8Y3tzm/0HV9OhhN+wQTNn X-Received: by 2002:a62:830e:: with SMTP id h14-v6mr327139pfe.64.1528234581142; Tue, 05 Jun 2018 14:36:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528234581; cv=none; d=google.com; s=arc-20160816; b=C/AyMZnRF9o/0OX3FTw2xIxMrFNF0dKyiGLh5o0dGk5LLmtbRQIV/TMH+9j1rLafVL Fq+ljEQClIu3ClQwCe8XF2Uw98MDlr+zbar+NoF6aoC1h9+HdT4FuICFuXaJHQKI77fU WKj8sfjT5A58NEbOyNw1Xrzv/bzHVsfPPgBoXxj1N4lnA9GnF7ZAloLkS2oLGPXoMALQ fHegk77aW5HI+3y4Rm9KnwQIncWlfsAFCNfTfOSkbTfRDLDJgAG9Zmr2PXGfgVcQ/YEp Pr04kyhx3x42d/dB5HH4MP/I9EGCPPT5yYuPj/2KBcIiNW704e8aEgjca6v6DyiOLapx Asqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:cc:to:from:subject :arc-authentication-results; bh=/w+DDFhWzOJzLpYtji0Hcqc8wKFfBjeMf/NUrJhnXhE=; b=yEaoFquOdKJ3ZWIt2ASswvktYgop7/Z746wCqAtBffQ/X6fGwbMYhlx4BcGqIIbtbz L7anCKfBE0krR0HNXF/GasTDY09U4FSLQ4rrfz3bgOK0z32hTcjrsOMs7AJmk8lJa8xl DPORO0m9HAo/f809eyJuIKq5y80Gxyi5CG/sY2MGr0S1pHxW5QPibiSAGUZHjrLXX3Nj ZvXgLi8HZP+sAxLIx9uH3/L2okztp+v52WMTKEqkQPpXc71kPMFE5h5K82GhhkUjqJB9 YFK6M4bPYtzvCzKWmTb6K4A4p2Gd5h5sRxLbTcISITwjGTCuw2rR2AK2Q18u8TNNCM2Q 2Odw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7-v6si6100452pfn.16.2018.06.05.14.36.06; Tue, 05 Jun 2018 14:36:21 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbeFEVff (ORCPT + 99 others); Tue, 5 Jun 2018 17:35:35 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:60442 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751721AbeFEVfe (ORCPT ); Tue, 5 Jun 2018 17:35:34 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w55LXXCN082937 for ; Tue, 5 Jun 2018 17:35:33 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2je133un7y-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 05 Jun 2018 17:35:33 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Jun 2018 22:35:24 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 5 Jun 2018 22:35:16 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w55LZF8J35193018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 Jun 2018 21:35:15 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A813DA405E; Tue, 5 Jun 2018 22:26:17 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EBDEA405D; Tue, 5 Jun 2018 22:26:16 +0100 (BST) Received: from dhcp-9-2-55-23.watson.ibm.com (unknown [9.2.55.23]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 5 Jun 2018 22:26:16 +0100 (BST) Subject: Re: [PATCH v4a 8/8] module: replace the existing LSM hook in init_module From: Mimi Zohar To: Kees Cook Cc: Paul Moore , linux-integrity , linux-security-module , LKML , David Howells , "Luis R . Rodriguez" , Eric Biederman , Kexec Mailing List , Andres Rodriguez , Greg Kroah-Hartman , Ard Biesheuvel , Jeff Vander Stoep , Casey Schaufler Date: Tue, 05 Jun 2018 17:35:13 -0400 In-Reply-To: References: <1527616920-5415-1-git-send-email-zohar@linux.vnet.ibm.com> <1527616920-5415-9-git-send-email-zohar@linux.vnet.ibm.com> <1527635645.3534.39.camel@linux.vnet.ibm.com> <1527780226.3427.20.camel@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18060521-0012-0000-0000-0000027B81CC X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060521-0013-0000-0000-000020AC88C3 Message-Id: <1528234513.3557.16.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-05_09:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=755 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806050241 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-06-05 at 12:45 -0700, Kees Cook wrote: > And if you must have a separate enum, please change this to fail > closed instead of open (and mark the fall-through): > > int rc = -EPERM; > > switch (id) { > case LOADING_MODULE: > rc = loadpin_read_file(NULL, READING_MODULE); > /* Fall-through */ > default: > break; > } This will fail the sysfs firmware fallback loading and the kexec_load syscall without any message, as you have for init_module.  Is that what you want? Mimi