Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8581827ybl; Thu, 16 Jan 2020 20:09:12 -0800 (PST) X-Google-Smtp-Source: APXvYqwJF1+FNTI41ioI1SO5zV+XJoedyNYf82nFjDLIwcLTXWUIBnHM9s7e7noFJfPl493URN7o X-Received: by 2002:a9d:24ea:: with SMTP id z97mr4783846ota.345.1579234152093; Thu, 16 Jan 2020 20:09:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579234152; cv=none; d=google.com; s=arc-20160816; b=bSwGy0Jj6SVYKiJvcXOT2yDKDGpaFOncKdPMXujMTQSHfdRXSlM99rHwnawh24b7GF R/GJgwWGJtp6QAOqhv2CxDHzsnfBr6nUiYA31cszAahvp+aGbnDIdNVN9XYi4HRpT2hw ITY8/TW0k9EPHUGrOTVGySeeen36oYGSWnLAbaDuUozqnufdBEndVqBSdT2B3tWZjMx3 4oO0SYqX7APIGrrOSzxigmdrWMvAjE1p0g4ZNrSG/JwcAVX6CsLHhhZ4WU3YdgZWRcSX PvckekEcN8uv+8rMZ0I3tn/EeS9fTlWCdVaJiSHcLsSTaT3+cfL73bZggBZmc7F1tESE eV/Q== 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; bh=HHzFVlOHW8HBury8S9C54L0Qq56he70Acb+4O8B6PMQ=; b=G4avZIZ54oFxttujP6nzZMQQWbS+VjbLGOTaPCyCItQH0kAg44rWnxREOWBhfrcdCH ivlXKonZoCtLltB8jwTI4rCh4od+RXuLWRR7SXeMe/Yzx6pmi9dUV1psBpYZKtVBFKKV LxufkGorTxzkNfhLtZ9UzONOSXH5Gh4HW9Tk3kLE9sK3sQ1k41Y+sszNUmZ8cnr9f+vB yBlxrrzXwJeI8UEdO/KMFxJlLW0ipAPIVFXDj+zBZBdAqNddTZcOTBIOMAWUaI2k5y2/ R6Y9+BHd8M1PeXd2vXbMQVhzrw8yNmaqUO/nduHy2no4pr7/PwooIDr2tbdPBG3wIkDz mXqA== 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 b67si3716947oii.79.2020.01.16.20.08.59; Thu, 16 Jan 2020 20:09:12 -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; 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 S1729366AbgAQDga (ORCPT + 99 others); Thu, 16 Jan 2020 22:36:30 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54392 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726366AbgAQDg3 (ORCPT ); Thu, 16 Jan 2020 22:36:29 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00H3WZWH003862 for ; Thu, 16 Jan 2020 22:36:28 -0500 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xk0qtp757-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 16 Jan 2020 22:36:28 -0500 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Jan 2020 03:36:26 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) 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) Fri, 17 Jan 2020 03:36:23 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00H3aNOo47644822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jan 2020 03:36:23 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E6D89A405B; Fri, 17 Jan 2020 03:36:22 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 307F8A4054; Fri, 17 Jan 2020 03:36:22 +0000 (GMT) Received: from localhost.localdomain (unknown [9.80.212.27]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 17 Jan 2020 03:36:22 +0000 (GMT) Subject: Re: [PATCH v2] IMA: pre-allocate buffer to hold keyrings string From: Mimi Zohar To: Lakshmi Ramasubramanian , linux-integrity@vger.kernel.org Cc: sashal@kernel.org, linux-kernel@vger.kernel.org Date: Thu, 16 Jan 2020 22:36:21 -0500 In-Reply-To: <20200117021821.2566-1-nramas@linux.microsoft.com> References: <20200117021821.2566-1-nramas@linux.microsoft.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: 20011703-0012-0000-0000-0000037E17C3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20011703-0013-0000-0000-000021BA4D57 Message-Id: <1579232181.5125.3.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-16_06:2020-01-16,2020-01-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 spamscore=0 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001170025 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2020-01-16 at 18:18 -0800, Lakshmi Ramasubramanian wrote: > ima_match_keyring() is called while holding rcu read lock. Since this > function executes in atomic context, it should not call any function > that can sleep (such as kstrdup()). > > This patch pre-allocates a buffer to hold the keyrings string read from > the IMA policy and uses that to match the given keyring. > > Signed-off-by: Lakshmi Ramasubramanian > Fixes: e9085e0ad38a ("IMA: Add support to limit measuring keys") Thanks!  This patch is now queued in next-integrity-testing. Mimi