From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Tue, 06 Aug 2019 07:58:53 +0000 Subject: Re: [PATCH] ia64:unwind: fix double free for mod->arch.init_unw_table Message-Id: <20190806075853.GA701@kroah.com> List-Id: References: <1565077593-72480-1-git-send-email-chenzefeng2@huawei.com> In-Reply-To: <1565077593-72480-1-git-send-email-chenzefeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: chenzefeng Cc: tony.luck@intel.com, fenghua.yu@intel.com, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org On Tue, Aug 06, 2019 at 03:46:33PM +0800, chenzefeng wrote: > The function free_module in file kernel/module.c as follow: > > void free_module(struct module *mod) { > ...... > module_arch_cleanup(mod); > ...... > module_arch_freeing_init(mod); > ...... > } > > Both module_arch_cleanup and module_arch_freeing_init function > would free the mod->arch.init_unw_table, which cause double free. > > Here, set mod->arch.init_unw_table = NULL after remove the unwind > table to avoid double free. > > Signed-off-by: chenzefeng > --- > arch/ia64/kernel/module.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) 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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 8EF59C433FF for ; Tue, 6 Aug 2019 07:58:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5D490217F4 for ; Tue, 6 Aug 2019 07:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565078337; bh=h/SZtPXyoVtslJ/aDAxmxK3G7rUocWNqG9K8r9KAwNM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=yLQgfWoFVER6Zf4YkwjshW1M/KI0u6tpYBlRbpLvVK2cpvONiSU0/0iZ1fPbmA2YM SIelYw26FxmkCQqO1BaJIWGHnMlRSAX0uI5ghOzhihXn31/WBDm0eQyOt/FUale8gt IgdaYwMvfZceL+3Kjw2iYNGivicnZWm+ljONM4+Y= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732126AbfHFH64 (ORCPT ); Tue, 6 Aug 2019 03:58:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:47134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728056AbfHFH64 (ORCPT ); Tue, 6 Aug 2019 03:58:56 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 18FF12070C; Tue, 6 Aug 2019 07:58:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1565078335; bh=h/SZtPXyoVtslJ/aDAxmxK3G7rUocWNqG9K8r9KAwNM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Ft2d60yt5RYukvor98l3LO4iOnt5V6kl6XcNkugZHqLca9jwwp57nWooNi9/QcQsK j2V707yx+kFTm773Cp/0B7hSI8zSGkzYrf0XJ6vpP7IxJ2AMAsiQfb8FCU1fwB21kt TzspB5IIf6Jio1QQTkV0f7/kCRboGJvniAReOSNc= Date: Tue, 6 Aug 2019 09:58:53 +0200 From: Greg KH To: chenzefeng Cc: tony.luck@intel.com, fenghua.yu@intel.com, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] ia64:unwind: fix double free for mod->arch.init_unw_table Message-ID: <20190806075853.GA701@kroah.com> References: <1565077593-72480-1-git-send-email-chenzefeng2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1565077593-72480-1-git-send-email-chenzefeng2@huawei.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 06, 2019 at 03:46:33PM +0800, chenzefeng wrote: > The function free_module in file kernel/module.c as follow: > > void free_module(struct module *mod) { > ...... > module_arch_cleanup(mod); > ...... > module_arch_freeing_init(mod); > ...... > } > > Both module_arch_cleanup and module_arch_freeing_init function > would free the mod->arch.init_unw_table, which cause double free. > > Here, set mod->arch.init_unw_table = NULL after remove the unwind > table to avoid double free. > > Signed-off-by: chenzefeng > --- > arch/ia64/kernel/module.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) 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.