From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A6D9C433DB for ; Fri, 5 Feb 2021 10:09:07 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A0E4E64FBB for ; Fri, 5 Feb 2021 10:09:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A0E4E64FBB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DXB343CjFzDwmt for ; Fri, 5 Feb 2021 21:09:04 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=srs0=tnco=hh=linuxfoundation.org=gregkh@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=MbIfqWAX; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DX9zR2p0KzDwg6 for ; Fri, 5 Feb 2021 21:05:55 +1100 (AEDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id DE67964FF1; Fri, 5 Feb 2021 10:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612519551; bh=bs0XNM8gkt3RASjOhVZFNWk8DM7IhwKfz2bXsbWngbY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MbIfqWAXQsPNyAuKIieIdtVLPMHJ4NI+F0LTN+UJt9FrMnXbzvB3pKdCfS/t5MwSl AK9Nuslo3MM1WLO3kiQenPY8+z6owyOWKcAu6jPwAgua3mIbi4ZH5luM6FwFl61tsH qTu+hDP9uUVP1Zduw88mqpxLB8Okw811bmSy6tMU= Date: Fri, 5 Feb 2021 11:05:48 +0100 From: Greg KH To: Lakshmi Ramasubramanian Subject: Re: [PATCH v2 2/2] ima: Free IMA measurement buffer after kexec syscall Message-ID: References: <20210204174951.25771-1-nramas@linux.microsoft.com> <20210204174951.25771-2-nramas@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210204174951.25771-2-nramas@linux.microsoft.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: sashal@kernel.org, dmitry.kasatkin@gmail.com, linux-kernel@vger.kernel.org, zohar@linux.ibm.com, tyhicks@linux.microsoft.com, ebiederm@xmission.com, linux-integrity@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, bauerman@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Thu, Feb 04, 2021 at 09:49:51AM -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. This buffer is not freed before > completing the kexec system call resulting in memory leak. > > Add ima_buffer field in "struct kimage" to store the virtual address > of the buffer allocated for the IMA measurement list. > Free the memory allocated for the IMA measurement list in > kimage_file_post_load_cleanup() function. > > Signed-off-by: Lakshmi Ramasubramanian > Suggested-by: Tyler Hicks > Reviewed-by: Thiago Jung Bauermann > Reviewed-by: Tyler Hicks > Fixes: 7b8589cc29e7 ("ima: on soft reboot, save the measurement list") > --- > include/linux/kexec.h | 5 +++++ > kernel/kexec_file.c | 5 +++++ > security/integrity/ima/ima_kexec.c | 2 ++ > 3 files changed, 12 insertions(+) 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.