From patchwork Mon Feb 6 14:02:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Berger X-Patchwork-Id: 53292 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2252695wrn; Mon, 6 Feb 2023 06:05:48 -0800 (PST) X-Google-Smtp-Source: AK7set/y6lzqrdbkVceK+5ZTrGZoZ6rPb13bIKXHjsFsFm+yophlZspLaTP2q8d5729WlMeDx0VI X-Received: by 2002:a17:902:f1ca:b0:198:fc83:9139 with SMTP id e10-20020a170902f1ca00b00198fc839139mr7011008plc.55.1675692348113; Mon, 06 Feb 2023 06:05:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675692348; cv=none; d=google.com; s=arc-20160816; b=t47WPKQOalGOW9qnrW0cVc6/TR2bfpA7CdsN3Sdu7E6TgcqfOmMkHLnvOVW8rwdlVN ZS9DPbRM1MyjnnJT6RSeeOYctM0ZCmjRKKIwYLv+GiQ9cHI/efXvUub7CbUOuKa77XSI BL8mipVKFQiqZMWYqjnY/ybhP/vcrXi5UaIq9bvfj+OGALKmycYciXYhHTR1pMlj351M H9RbvmMTkjrHGuU6qs8020pyhtGUTGePmrBs2G0kdAsi9xHXmBNcjtXod4A2dOEMRJ4R xAl/HETqu9bh8d3vYZ4xv6TeY67CnMaAFnMKKqsqWR+i+1LUfctIgODNXEu7FDLzHtCC EhZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CZP+InDTAq0So4cgPVablNaZRJXNzCvrDwoSplGTOys=; b=jTx0G8wnYWiTD7cP/ZkvI/OsMUNdSNJR6nd+eZHGBdqIhGxtpTB4B5IxmEI20ZdrUJ S4cL/y+JUAIj8MaaE7W/HdjTlYDwzXNOFODlMtRI/5FGUvCvjPWrcrItJ3SJEM3biEHH ALCeQ45iW+yYme3dV+ygSMeMMixHIPgLiUMfdGKD38SAhhYtmDZtRKN2O32+HGXzq4We mVGbas0JN38pQVdF+ciNgJEJmLiKimqgIUE8kIIY42DcRp/DnuKGrJCSBu211C3lDTrO EixwLR4BjRR+qP5Ln0VmkHU7M+wWpR2fMhnuo5iR1Uq9k74zfzdaGhwTF6hdLKG/tcCI qSBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=eQE+FC3c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a633c44000000b004b1d3738f5bsi12449215pgn.390.2023.02.06.06.05.32; Mon, 06 Feb 2023 06:05:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=eQE+FC3c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231324AbjBFOE2 (ORCPT + 99 others); Mon, 6 Feb 2023 09:04:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230230AbjBFOD6 (ORCPT ); Mon, 6 Feb 2023 09:03:58 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47D64193DC; Mon, 6 Feb 2023 06:03:47 -0800 (PST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 316DqOd9023216; Mon, 6 Feb 2023 14:03:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=CZP+InDTAq0So4cgPVablNaZRJXNzCvrDwoSplGTOys=; b=eQE+FC3cQyr8VDteDFdM+Nyu+GJH+nInDDEoEBe+WhtdlDRICQY0lbIt4RuPI8+oxYID o2yxpE2RAlc/9TU05BdrXn7Rrr9Sa8U5gYROpvsulmppQScVkdn/HBwSZQtutMtls/VI 3N7Qst4AhO5jgFhLBVJtEAJYLFx+RW9kAQy/sNzzqGzvrrKE23Z0EumZjwMylaIdK4hV E4BNe1w/01akOeNJJATPSmyRyiMldfI0ucrqvjQOpQkuyvqs3sEKb85xfohNNxozPmco QwQg5RLypsw5ujSz1osOM6WWMygwgVQz0oB5xm3qm3O6F+xcN613uGsp4JuMEOgdvpJe vw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk2tf0cha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 14:03:22 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 316DqRh5024552; Mon, 6 Feb 2023 14:03:22 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nk2tf0cgj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 14:03:21 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 316C0fjs001067; Mon, 6 Feb 2023 14:03:20 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma01wdc.us.ibm.com (PPS) with ESMTPS id 3nhf072yhn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Feb 2023 14:03:20 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 316E3JCe35455734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Feb 2023 14:03:19 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 796845805C; Mon, 6 Feb 2023 14:03:19 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A0CFA5805B; Mon, 6 Feb 2023 14:03:17 +0000 (GMT) Received: from sbct-3.pok.ibm.com (unknown [9.47.158.153]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 Feb 2023 14:03:17 +0000 (GMT) From: Stefan Berger To: linux-integrity@vger.kernel.org Cc: zohar@linux.ibm.com, serge@hallyn.com, brauner@kernel.org, containers@lists.linux.dev, dmitry.kasatkin@gmail.com, ebiederm@xmission.com, krzysztof.struczynski@huawei.com, roberto.sassu@huawei.com, mpeters@redhat.com, lhinds@redhat.com, lsturman@redhat.com, puiterwi@redhat.com, jejb@linux.ibm.com, jamjoom@us.ibm.com, linux-kernel@vger.kernel.org, paul@paul-moore.com, rgb@redhat.com, linux-security-module@vger.kernel.org, jmorris@namei.org, jpenumak@redhat.com, Stefan Berger Subject: [PATCH v15 09/26] ima: Move ima_lsm_policy_notifier into ima_namespace Date: Mon, 6 Feb 2023 09:02:36 -0500 Message-Id: <20230206140253.3755945-10-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230206140253.3755945-1-stefanb@linux.ibm.com> References: <20230206140253.3755945-1-stefanb@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: z9p5hcknS4pyPIkYgBLchDHJASufR6qV X-Proofpoint-ORIG-GUID: GUvVqS587z5HOXR2UFB4jpspTjLkX4FT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-06_07,2023-02-06_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 clxscore=1015 mlxscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302060116 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757090779855179113?= X-GMAIL-MSGID: =?utf-8?q?1757090779855179113?= Move the ima_lsm_policy_notifier into the ima_namespace. Each IMA namespace can now register its own LSM policy change notifier callback. The policy change notifier for the init_ima_ns still remains in init_ima() and therefore handle the registration of the callback for all other namespaces in init_ima_namespace(). Rate-limit the kernel warning 'rule for LSM