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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 9E492C433E0 for ; Fri, 5 Feb 2021 23:23:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5F0D264FDE for ; Fri, 5 Feb 2021 23:23:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229691AbhBEXUJ (ORCPT ); Fri, 5 Feb 2021 18:20:09 -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-integrity@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. 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 9EE05C433DB for ; Fri, 5 Feb 2021 10:07:31 +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 A6BA564FB9 for ; Fri, 5 Feb 2021 10:07:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6BA564FB9 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 4DXB1B24xQzDwj8 for ; Fri, 5 Feb 2021 21:07:26 +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=W6Q0p10Z; 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 4DX9zJ2bdSzDwfj for ; Fri, 5 Feb 2021 21:05:48 +1100 (AEDT) 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 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> 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: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.