Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2612910ybe; Sat, 14 Sep 2019 19:37:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyB3gpWv0zz2ZfzXorzEtEKrnCXK0LQZrHNmmwlcso77oUybZK2/mvfGtMBKPYKA9MfY32Z X-Received: by 2002:a50:fd96:: with SMTP id o22mr50991299edt.218.1568515073203; Sat, 14 Sep 2019 19:37:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568515073; cv=none; d=google.com; s=arc-20160816; b=szU0S80oG3skt+qe3Fh9DHcBtejl/Q7FR9spH08ITlabKTQJykDTw0J9gfVNurtOHg uJIr7laPxtBezo7c3WA2dMfRwit0yK6WdiSREr3vFNukjgP/IUKRfeDv72yWzwnCjIgA E6yqa8edi0vJx8oicaig7TBjyrE8EYSD0xj89igReXo7AJXZUNBUGLDcnA2/ub6y1JKG 6ixWDzVVEfCaCo8kCtJGOgaMxg2X+HTx3hWgYFqPsBGjp8pxRF4p/p24UcyUMG8xxyg9 uS9KickmoF8NEApWr8agVW2lMc+iIUYQbB85M6VqwMCQk3U1Bi8pP+vX5f/zeG20RsVv QZJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=pVY7GYznZUijjBc7X2tclsJfpGNz8NESBfTF4Oaa2qY=; b=abuuNlmk0H0IxZphR3zM3NCAOWJfQMCGqu7CR04FFvK+vPdSoWLZ5s6OCnu5g8Ntxw 3sOjuMFhWtV2gNTrEsYmm8Ge+jz/jvPrQU4+IJszBf0SUloUTGT75+Id2u72p0fxIWWr LE9svsduSTwpUxqeKDs5kdGVqkn5N6Z0CseBthNbWZkFF5lW2DmkouTrVJ+aPRdaSRdW ok1prtjCOUCs3qo4X+NruyLv+declFFNU3IPIVXLl4Tw+eRAqhxD9QpZkVSa2gs/R9bW ss0OHvGSU08uuEAdVFCZutmQOl8TrQ3QC4Nj/JxLJc3JwLeTfTN8CupAFwlL/WK4wqzL XR6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aCfDZsbW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si577295ejy.106.2019.09.14.19.37.29; Sat, 14 Sep 2019 19:37:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=aCfDZsbW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727011AbfIOBI6 (ORCPT + 99 others); Sat, 14 Sep 2019 21:08:58 -0400 Received: from mail-oi1-f195.google.com ([209.85.167.195]:41037 "EHLO mail-oi1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbfIOBI6 (ORCPT ); Sat, 14 Sep 2019 21:08:58 -0400 Received: by mail-oi1-f195.google.com with SMTP id w17so5619580oiw.8 for ; Sat, 14 Sep 2019 18:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:reply-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=pVY7GYznZUijjBc7X2tclsJfpGNz8NESBfTF4Oaa2qY=; b=aCfDZsbWEAWGGRMky2a5nmbJNhj/4+ui7XoQwZ3ntNOVLaO1OYoLJe3jVDKBsxA54q I/EUDSWo9IUqdsl0vs/o+E9FjdxbNKikEeAS11oMyuzx2KyeFadayPu68SLOqdxIYK3i plU1/lDlNs0YiFGQKMepyrmiPm4gfdHW3OZnnklSmEgCjAex31ctzzB1g2P70K5VO3k6 svRrr1/GNpgusqNsKe8p/ht1MkfWX1ei98ZK47BkOGbzQ3c3cRgIAAm+/+uBz4xnW5zK 7PMpdtAiaYyjDfqhRXBmNu024ExalLi4X/frubr281H0TaWGYDQ4koZHUCbeDiN0KsNl zxSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :reply-to:references:mime-version:content-disposition:in-reply-to :user-agent; bh=pVY7GYznZUijjBc7X2tclsJfpGNz8NESBfTF4Oaa2qY=; b=uNjhk7SMfPRtmlU4TPXAF16mwBb0BhwfgLB4MRafHE0QmlPZ6bcVkaGbhP8JF7hAlb fVoz6W5BYybOgSG7a+hjFQiveFPZAVHYn+JnGblhqXLNPGC2eOPjVQTVe1V55vRugwdE 7cYoqkwQp5WD9KwV5CuHCuIFDdVdd1lJ9m3ymmMMXOaC9lP1k2BXbiGFOCOgGnd3qF0S 1OJ8IaUioaLSZaKcEhKNSWFiQMxGuvaooEZwAMMMgxfTb1kKcDBx+QIbVoc5KoDzoI8A B7uqrUrUCcCz65nWkT9+1zmR/0KgvFo75Mor8e4kBV+RJvksK2NnoihjA/4h57kCFSjb 4KMw== X-Gm-Message-State: APjAAAXDKU/BG34AbA8r+IIHJzPnN5cmLTtZq6z+z8u5Sa0monLj5PtB Rdj/PQRq/abWRmLAiEaPYQ== X-Received: by 2002:a54:418a:: with SMTP id 10mr9079555oiy.88.1568509736833; Sat, 14 Sep 2019 18:08:56 -0700 (PDT) Received: from serve.minyard.net (serve.minyard.net. [2001:470:b8f6:1b::1]) by smtp.gmail.com with ESMTPSA id 93sm12736604ota.16.2019.09.14.18.08.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Sep 2019 18:08:55 -0700 (PDT) Received: from t560 (unknown [192.168.27.180]) by serve.minyard.net (Postfix) with ESMTPSA id B00271800D0; Sun, 15 Sep 2019 01:08:53 +0000 (UTC) Date: Sat, 14 Sep 2019 20:08:52 -0500 From: Corey Minyard To: Jes Sorensen Cc: openipmi-developer@lists.sourceforge.net, kernel-team@fb.com, linux-kernel@vger.kernel.org Subject: Re: [Openipmi-developer] [PATCH 0/1] Fix race in ipmi timer cleanup Message-ID: <20190915010852.GG13407@t560> Reply-To: minyard@acm.org References: <20190828203625.32093-1-Jes.Sorensen@gmail.com> <20190828223238.GB3294@t560> <15517bfc-3022-509d-15ea-c2b8e7a91e0a@gmail.com> <20190829181536.GC3294@t560> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829181536.GC3294@t560> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > > > > {disable,enable}_si_irq() themselves are racy: > > > > static inline bool disable_si_irq(struct smi_info *smi_info) > > { > > if ((smi_info->io.irq) && (!smi_info->interrupt_disabled)) { > > smi_info->interrupt_disabled = true; > > > > Basically interrupt_disabled need to be atomic here to have any value, > > unless you ensure to have a spin lock around every access to it. > > It needs to be atomic, yes, but I think just adding the spinlock like > I suggested will work. You are right, the check for timer_running is > not necessary here, and I'm fine with removing it, but there are other > issues with interrupt_disabled (as you said) and with memory ordering > in the timer case. So even if you remove the timer running check, the > lock is still required here. It turns out you were right, all that really needs to be done is the del_timer_sync(). I've added your patch to my queue. Sorry for the trouble. Thanks, -corey