Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp480088pxb; Wed, 3 Feb 2021 09:50:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfAoPxtwuxcF3NdJSTjwXZQpFIAyUGFno4NZkS4ne/f6/jPryxcCvNEItm186RJBK1Q8Xk X-Received: by 2002:a17:906:6087:: with SMTP id t7mr4403094ejj.90.1612374615722; Wed, 03 Feb 2021 09:50:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612374615; cv=none; d=google.com; s=arc-20160816; b=iXIcpL9Xb7Uv/oI6z1vk5uOqytl82aGxPtrMoNvgcXvw55pUwfYtlTErvnwKnlD/dz 66M5jduSGrfO8RMVmLxsKVvq3CoCvmL9j5fsHU95kTJRhA3YYiFwqi9gzlh/KxNAQmAO YLzFygMhEE0z1Pe4Kb2MI1ZEkMAwRLuptkLMaIEPHvlc7g4gANIooiBQP4T4ok44AvlY FcQtpuxEPk7mjnhXzYuXopFcPDXug6jEtdTOHWNNgRRNmSMnjtnt5KBOGdnuinui0QmA tBs80GlaFDKWS/Ay0cAsNHCjLmUoDJTrcECfNZXiVhJxl/39OAHPniiFatw5D1PDbKv4 GmBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:dkim-filter; bh=3RICIW6ifzknABr+efjv9dnif1PvuEM7vXwzp3I9uVk=; b=VWi022MhzvlU6Jp2+6v5/HevlNChlEvQZtBWlptUSE2NRNwZQy1RxuhiXnpR5+yyGl Vnl2uabBS+nIgkWcgmJ8Z4uHUYSSTEo7RnZdaj5U9B6D6jYIU8hcUgXv5xHaav88oqk+ TzSI6JNLz6h6g+wK8Mrv5gq9UDbYELEsV+MSDUEH8uMB/eYQNDg9W3tlJTUxsXDrrsc/ 93O2QoD7Sh7wkyvPLsU99M4FNKsgmzqQjWAnoy2akMhfaBf0AZfb7L3to38I0gqmgM6i UhHPKYr+Oq4H5/F5vCte68jLSVZcqyOK1ojVL/DZPZBv3LOVJ+094/inRuRbVUbv7PsW nFBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=VnGV5Ki1; 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=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr35si1832701ejc.274.2021.02.03.09.49.46; Wed, 03 Feb 2021 09:50:15 -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=@linux.microsoft.com header.s=default header.b=VnGV5Ki1; 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=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231906AbhBCRrX (ORCPT + 99 others); Wed, 3 Feb 2021 12:47:23 -0500 Received: from linux.microsoft.com ([13.77.154.182]:53666 "EHLO linux.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231656AbhBCRrW (ORCPT ); Wed, 3 Feb 2021 12:47:22 -0500 Received: from [192.168.0.104] (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 8B01220B7192; Wed, 3 Feb 2021 09:46:41 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 8B01220B7192 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1612374401; bh=3RICIW6ifzknABr+efjv9dnif1PvuEM7vXwzp3I9uVk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=VnGV5Ki16nGyG3QUZJWQdHCAoC9+Yhc9TlgiDzQpGOKycF5QkederFZHOZYJJ8slr woSSRz8xuZhkVFjEzfi+5M9o3WEZIGtPWrDXd08IPVQVi4b+IUxQrpFIeNwXFDZT3x kQOB8ZbFSbPOREgVwvK77c8ZRNoycRwlegERH3RE= Subject: Re: [PATCH 2/2] ima: Free IMA measurement buffer after kexec syscall To: Thiago Jung Bauermann Cc: zohar@linux.ibm.com, dmitry.kasatkin@gmail.com, ebiederm@xmission.com, gregkh@linuxfoundation.org, sashal@kernel.org, tyhicks@linux.microsoft.com, linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <20210121173003.18324-1-nramas@linux.microsoft.com> <20210121173003.18324-2-nramas@linux.microsoft.com> <87bldg1u3s.fsf@manicouagan.localdomain> From: Lakshmi Ramasubramanian Message-ID: <15fb8c53-2aa0-dc5e-123d-87fee78aacb5@linux.microsoft.com> Date: Wed, 3 Feb 2021 09:46:40 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <87bldg1u3s.fsf@manicouagan.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/22/21 2:31 PM, Thiago Jung Bauermann wrote: > > Lakshmi Ramasubramanian writes: > >> 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 >> Fixes: 7b8589cc29e7 ("ima: on soft reboot, save the measurement list") > > Good catch. > > Reviewed-by: Thiago Jung Bauermann > Thanks Thiago. -lakshmi