From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752194AbeFEVff (ORCPT ); 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 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 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