Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2412089pxb; Fri, 29 Oct 2021 00:25:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsIakUiLtrE31MbxClVxy6+Ni1Wy1uivKCyKdLoY8lQhuEDv+tNPh5KYDKLwM7WSxj/McZ X-Received: by 2002:a17:902:bd01:b0:140:4094:c70a with SMTP id p1-20020a170902bd0100b001404094c70amr8284957pls.70.1635492354041; Fri, 29 Oct 2021 00:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635492354; cv=none; d=google.com; s=arc-20160816; b=IsnLfaEUo5F4lJzqxXJ3nr+bbBR6x4YgC6MBcMCFUfpOytR2kw820neQF8HSYb/zo7 v5KQSKJrozfTP3Y2K5Y84wDznGgELpiFwuYJvNXRjtwi/vQcA3Vfq+0Iycjyp1CftktO GCEoAv9ywTd18hNEisdhV/zPcdbaD/Fd76cLUo0CbXNw3aBOMGncWqFwq0SUVIfraikz N1PO2I9CTMPTBx8STMcZ09BaDLTascSy8ggP3ZnW/7sEEUPfy4Cm+QQfmHGBRdnOx8Iu oZ3qdziuj82mWwtk6JMtVfbD7dv/9/KSzp+LqT3jnintNSpW9xZbjck8FCo5TZyB/EEU o4jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=m2M2Xvi4xU573wLggrm/ueEHI68FY/6gBxFejbXAvI8=; b=inSnJU2zqC2vzD/ON+2s60W+mwRDV80V3WYO147HnzVCj5VHNAzMxF85eC2e0PIVWr jJDZD6flZHKN2kYlPKPqG5iSGeoXzrhHZzDtpUN5rguA9lcgjcFVD2RqP6JAvaDRY8pg PeFuEiuEa/q0QgjZSybkNry/5FOmpRdzjtOaU6+ZX9Z8hXxmB3aDrjZQlXVLujYv2oTW W4RiNapDjbRwoX0mVZeKWCF8JIEbrXwBQx6PVmjStcRIjK3bDnyGsYHAl/hbdsmje+1w ESRxPWqNBuLOy15E11lXLeM4GynLkyYqETA4pGXYF5yo4fbc1Kyy/Prbp6+r2lzzbiP9 p+OQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GrZgvI3G; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x1si8468697pgj.248.2021.10.29.00.25.40; Fri, 29 Oct 2021 00:25:54 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=GrZgvI3G; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbhJ2H1N (ORCPT + 99 others); Fri, 29 Oct 2021 03:27:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52871 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhJ2H1N (ORCPT ); Fri, 29 Oct 2021 03:27:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635492284; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=m2M2Xvi4xU573wLggrm/ueEHI68FY/6gBxFejbXAvI8=; b=GrZgvI3G1A3jXpaLo+RnXshFag755PlCPwgcluwTq8W8X4dgX0lT8TGowBxhh/txZjkEqN Mjt2a73EVPQsuZEYS/mrcXsIH1A14QTy/gHrHenwT2ny+VtTFlhBluu+0Rwhdb+gcS0GXE y/tM6LZo1qRnkORYzWAFxB5YqVfVcvU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-590-iHCuhfqmMkWIhwvGK_Hidg-1; Fri, 29 Oct 2021 03:24:43 -0400 X-MC-Unique: iHCuhfqmMkWIhwvGK_Hidg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37B83362FB; Fri, 29 Oct 2021 07:24:42 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-171.pek2.redhat.com [10.72.12.171]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F5F43A08; Fri, 29 Oct 2021 07:24:35 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: kexec@lists.infradead.org, dyoung@redhat.com, akpm@linux-foundation.org, Baoquan He Subject: [PATCH 0/3] x86/kexec: fix memory leak of elf header buffer Date: Fri, 29 Oct 2021 15:24:21 +0800 Message-Id: <20211029072424.9109-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The memory leak is reported by kmemleak detector, has been existing for very long time. It could casue much memory loss on large machine with huge memory hotplug which will trigger kdump kernel reloading many times, with kexec_file_load interface. And in patch 2, 3, clean up is done to remove unnecessary elf header buffer freeing and unneeded arch_kexec_kernel_image_load(). Baoquan He (3): x86/kexec: fix memory leak of elf header buffer x86/kexec: remove incorrect elf header buffer freeing kexec_file: clean up arch_kexec_kernel_image_load arch/x86/kernel/machine_kexec_64.c | 23 +++++++++-------------- include/linux/kexec.h | 1 - kernel/kexec_file.c | 9 ++------- 3 files changed, 11 insertions(+), 22 deletions(-) -- 2.17.2