Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2373273pxb; Fri, 5 Feb 2021 16:50:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJynRNUo1dBSyPHW75k9BSRsOrp3IrPQcAWqmb1gL8lg7a+RJY0V0X2V8X+tuukC5JTjACK6 X-Received: by 2002:a17:907:11c7:: with SMTP id va7mr6493631ejb.351.1612572622333; Fri, 05 Feb 2021 16:50:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612572622; cv=none; d=google.com; s=arc-20160816; b=bmlzD7zQiXAJBDCIs8zX5RugrptYRxjmuT+003+EeiDWTiOsi0gZjgT4lJv62OGCdy 6YHQMfHAFveIB0MzR+ft+4vGfCvtl5cxft38/JZxwAS41Pnvgb7IOqyAnXgDF+Yd0mRg qMjwYYKJi73btNpFpjxdZnjeDu9Mxkopnot0bnZ9POCFO05fDn+SRLYPFlyfJ8fZYhIm YhP0BFz7aKMuz8I0yBAzQ9EkJOPGbUkh3doixKBB+/rQGTAfOgGWvkDtabH1Hr/h9cUp 39/o0kLSHDehY3VnEwrVPBB4hsrWcKjNqHh5hJceE2VCuWxtuRfo+UiBsifecRNOLQ2+ yhkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x7okSV6jDkHaSMNe/aP3jtkd/RDgEzS2kXE31bzm96E=; b=W1GhfHvGpWB2cN7YHG13AhJllJtsnqAFTYAeCvloDW/Z/6KnsVYNRoj392r8GQFDum nRAFkmxkuoanmCQI0qf+IXq6M6z47XBPEsY3xX2XrjlCQPRaCT3x0U5eeMBf4SCx8RXv VYv7CKG+6rBUKHyoh6iueK7vMXCB4J0F2sQU1zmGZHsGTUHLJuX81YJsjCOi7+xQ0C0/ H5oQHBNZ5slpmQgVqZp1tLmAMwraWZWoxpS+PTWgceCZKdUVjJ1iST6izrzcjknz1Fqq LwkuhU4ijwmwHIlfpyImVQe/2+g9w4CVqgcWaodlQhKVNqoyz0XbHlE9ahasrPtkMh0m U8Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W6Q0p10Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si7707157eds.167.2021.02.05.16.49.58; Fri, 05 Feb 2021 16:50:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=W6Q0p10Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229997AbhBFArE (ORCPT + 99 others); Fri, 5 Feb 2021 19:47:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:52742 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbhBEKGd (ORCPT ); Fri, 5 Feb 2021 05:06:33 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3B66764FDB; Fri, 5 Feb 2021 10:05:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612519544; bh=scnkNV3b88L2nKBqb1usuyBtXEqbdj6p/tdhfcQT/fA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=W6Q0p10ZV4qOxpqOl55bYsgZ4v+JW/RikcOOXr7vvwHLGR8do1jBfGRxnRD5fRXmk Qvd+HE/kP32hKgT/CbwF2O2Q9e/1KXPRXVlbWUqBllgxZEhnsGn1iVKa2ipj9SH7uK P5iQMU9NriKkEzsj/UnBTHkOLK3nzpA5jxUv+v7w= Date: Fri, 5 Feb 2021 11:05:42 +0100 From: Greg KH To: Lakshmi Ramasubramanian Cc: zohar@linux.ibm.com, bauerman@linux.ibm.com, dmitry.kasatkin@gmail.com, ebiederm@xmission.com, sashal@kernel.org, tyhicks@linux.microsoft.com, linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] ima: Free IMA measurement buffer on error Message-ID: References: <20210204174951.25771-1-nramas@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210204174951.25771-1-nramas@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 09:49:50AM -0800, Lakshmi Ramasubramanian wrote: > IMA allocates kernel virtual memory to carry forward the measurement > list, from the current kernel to the next kernel on kexec system call, > in ima_add_kexec_buffer() function. In error code paths this memory > is not freed resulting in memory leak. > > Free the memory allocated for the IMA measurement list in > the error code paths in ima_add_kexec_buffer() function. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Tyler Hicks > Fixes: 7b8589cc29e7 ("ima: on soft reboot, save the measurement list") > --- > security/integrity/ima/ima_kexec.c | 1 + > 1 file changed, 1 insertion(+) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.