From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f175.google.com ([209.85.212.175]:37442 "EHLO mail-wi0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753195AbbF3MRh (ORCPT ); Tue, 30 Jun 2015 08:17:37 -0400 Received: by wicgi11 with SMTP id gi11so14815218wic.0 for ; Tue, 30 Jun 2015 05:17:35 -0700 (PDT) Subject: Re: [PATCH V2] kernel/smp.c: fix a panic as cp->info is used wrongly and a, list corruption To: Pan Xinhui , stable@vger.kernel.org References: <5555B683.9070300@intel.com> From: Jiri Slaby Message-ID: <559288DC.5020401@suse.cz> Date: Tue, 30 Jun 2015 14:17:32 +0200 MIME-Version: 1.0 In-Reply-To: <5555B683.9070300@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On 05/15/2015, 11:04 AM, Pan Xinhui wrote: > this patch reverts commit 3440a1 which causes the regression and fix a > list corruption. > > 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 will lost control of pointer cp. > cp is passed in and may be freed later in other places. > > Signed-off-by: Pan Xinhui > --- > Changes in v2: > no codes changed from v1, just update the comment. > upstream commit fc21c0 fix this issue, as it removes the total feature. :) > the buggy codes exist in v3.10 and v3.12. Applied fc21c0cff2f425891b28ff6fb6b03b325c977428 to 3.12. Thanks. -- js suse labs