Return-Path: Received: from out4-smtp.messagingengine.com ([66.111.4.28]:45937 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932334AbbELMPE (ORCPT ); Tue, 12 May 2015 08:15:04 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D5D3020CF4 for ; Tue, 12 May 2015 08:15:01 -0400 (EDT) Date: Tue, 12 May 2015 05:14:59 -0700 From: Greg KH To: Pan Xinhui Cc: stable@vger.kernel.org Subject: Re: [PATCH] kernel/smp.c: fix a panic as cp->info is used wrongly and a list corruption Message-ID: <20150512121459.GB25401@kroah.com> References: <55531348.1080902@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55531348.1080902@intel.com> Sender: stable-owner@vger.kernel.org List-ID: On Wed, May 13, 2015 at 05:03:04PM +0800, Pan Xinhui wrote: > this patch reverts commit 3440a1ca99707f093e9568ba9762764d3162dd8f which causes the regression. > > base knowledge: kernel call cp->func using cp->info as its argument. like cp->func(cp->info); > > current code is totally wrong, as 1) &softirq is at stack. 2) cp->info don't point to struct call_single_data. > So in remote_softirq_receive, > 1) If the caller had left __try_remote_softirq, dereferencing cp->info could not fetch the correct value. > 2) And we can't get struct call_single_data *cp anymore. > > The list corruption is below. > __local_trigger will add cp->list into softirq_work_list. But no one will delete cp->list on behalf of us. > if we can succeed to raise_softirq_irqoff, we must delete it from softirq_work_list. because we has lost control of pointer cp. > cp is passed in and may be freed later in other places. > > Cc: # 3.10 > Signed-off-by: xinhuix.pan > --- > include/linux/smp.h | 1 + > kernel/softirq.c | 10 +++++++--- > 2 files changed, 8 insertions(+), 3 deletions(-) This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read Documentation/stable_kernel_rules.txt for how to do this properly.