From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQJcK-0003wq-1o for kexec@lists.infradead.org; Tue, 05 Jun 2018 21:35:57 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w55LXbku048842 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 2jdwrrd9mu-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 Subject: Re: [PATCH v4a 8/8] module: replace the existing LSM hook in init_module From: Mimi Zohar 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> Mime-Version: 1.0 Message-Id: <1528234513.3557.16.camel@linux.vnet.ibm.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "kexec" Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Kees Cook Cc: Paul Moore , Ard Biesheuvel , Greg Kroah-Hartman , Kexec Mailing List , "Luis R . Rodriguez" , LKML , David Howells , linux-security-module , Eric Biederman , Jeff Vander Stoep , Casey Schaufler , linux-integrity , Andres Rodriguez T24gVHVlLCAyMDE4LTA2LTA1IGF0IDEyOjQ1IC0wNzAwLCBLZWVzIENvb2sgd3JvdGU6Cgo+IEFu ZCBpZiB5b3UgbXVzdCBoYXZlIGEgc2VwYXJhdGUgZW51bSwgcGxlYXNlIGNoYW5nZSB0aGlzIHRv IGZhaWwKPiBjbG9zZWQgaW5zdGVhZCBvZiBvcGVuIChhbmQgbWFyayB0aGUgZmFsbC10aHJvdWdo KToKPiAKPiBpbnQgcmMgPSAtRVBFUk07Cj4gCj4gc3dpdGNoIChpZCkgewo+IGNhc2UgTE9BRElO R19NT0RVTEU6Cj4gICAgIHJjID0gbG9hZHBpbl9yZWFkX2ZpbGUoTlVMTCwgUkVBRElOR19NT0RV TEUpOwo+ICAgICAvKiBGYWxsLXRocm91Z2ggKi8KPiBkZWZhdWx0Ogo+ICAgICBicmVhazsKPiB9 CgpUaGlzIHdpbGwgZmFpbCB0aGUgc3lzZnMgZmlybXdhcmUgZmFsbGJhY2sgbG9hZGluZyBhbmQg dGhlIGtleGVjX2xvYWQKc3lzY2FsbCB3aXRob3V0IGFueSBtZXNzYWdlLCBhcyB5b3UgaGF2ZSBm b3IgaW5pdF9tb2R1bGUuIMKgSXMgdGhhdAp3aGF0IHlvdSB3YW50PwoKTWltaQoKwqAKCgpfX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwprZXhlYyBtYWlsaW5n IGxpc3QKa2V4ZWNAbGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwOi8vbGlzdHMuaW5mcmFkZWFkLm9y Zy9tYWlsbWFuL2xpc3RpbmZvL2tleGVjCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39918 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751666AbeFEVfe (ORCPT ); Tue, 5 Jun 2018 17:35:34 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w55LXYhX114650 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 2je26f0tkw-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 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" Mime-Version: 1.0 Message-Id: <1528234513.3557.16.camel@linux.vnet.ibm.com> Sender: linux-integrity-owner@vger.kernel.org List-ID: 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 From mboxrd@z Thu Jan 1 00:00:00 1970 From: zohar@linux.vnet.ibm.com (Mimi Zohar) Date: Tue, 05 Jun 2018 17:35:13 -0400 Subject: [PATCH v4a 8/8] module: replace the existing LSM hook in init_module 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> Message-ID: <1528234513.3557.16.camel@linux.vnet.ibm.com> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.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 ? -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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