Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1187946ybl; Thu, 12 Dec 2019 11:01:10 -0800 (PST) X-Google-Smtp-Source: APXvYqyehMj1iA0RJns22GNE6yH8syol0QkjEa6k4nWNEs0NdUuiNBNh999NNGrErUG4p+KmRhRW X-Received: by 2002:a9d:708a:: with SMTP id l10mr9348634otj.263.1576177269922; Thu, 12 Dec 2019 11:01:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576177269; cv=none; d=google.com; s=arc-20160816; b=dLtyzZnDAl+YbYWrJIXqES1ZyFvVXdDR98OnXknuGnXsLtDDPu4ZDs8/H5V55gwer9 9nVNbdSLrfGOpjKRqISqZFk7k48fZfI9R61KCGm9De5c/UrLNdUOmLCDXv74wtakzk7z bvinbQw2NfFs0b0PoBFM3dmOWj4xEbb0JfdDOYnGWrGr4GD3EuQtz3ySst/Gr36efYVu 2hAlNL5bdZUQPgvXXfYCZZvhcOZk4vj2GFnt8bibD2DsIuOMMlD9rH2Zcs2gACOkfZ+s BI7vQa5kDpJ0oHWOAbfan+UIrm9VOSEr6rqpai4Se7c4HwvguCvpTwI3Elzgjv97NzHj GO8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=6ku/Se3P4O64xGuBmzoaR/pUUBtjwdZyGjd61Lo+PTc=; b=jZqDPZ84phJwX1Z/irDeqRyO/V0tHjOIWyzXdMrCFh+d/6CS2mo0iC7xutiOsP3j3U L0MaXPCKcLx5qgvQy382FZvjR8serNDxXDrhsz7A+bPGsSA55gqHon/H5pLp/i3Zxe8F Xl0LH0rHD576Kw4SYeHUs2ivAUzLkrqg+YGPsgGTN6o2xD3oPJtiPox54tU8y/rB5EEC T0B4dWPWyJPs0ZA9A3XJWm+tPA/IDdIekMQ9QN7IPsj5q0HhLZZc48Rfjcxl16x4FTad y20IxPbbfF4C+L7lsnUQ76CV2SGWm8iHwPKN3w0FZxUX7w0uR7L4FvQROA4/4zuKfXVc sy6A== ARC-Authentication-Results: i=1; mx.google.com; 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 e17si3614041oti.89.2019.12.12.11.00.56; Thu, 12 Dec 2019 11:01:09 -0800 (PST) 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; 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 S1730608AbfLLTAX (ORCPT + 99 others); Thu, 12 Dec 2019 14:00:23 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:42672 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730261AbfLLTAU (ORCPT ); Thu, 12 Dec 2019 14:00:20 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:1c3::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id B7C16153DFA42; Thu, 12 Dec 2019 11:00:19 -0800 (PST) Date: Thu, 12 Dec 2019 11:00:19 -0800 (PST) Message-Id: <20191212.110019.462290546870002203.davem@davemloft.net> To: pdurrant@amazon.com Cc: netdev@vger.kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, jgross@suse.com, jakub.kicinski@netronome.com, wei.liu@kernel.org Subject: Re: [PATCH net] xen-netback: avoid race that can lead to NULL pointer dereference From: David Miller In-Reply-To: <20191212123723.21548-1-pdurrant@amazon.com> References: <20191212123723.21548-1-pdurrant@amazon.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 12 Dec 2019 11:00:20 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Durrant Date: Thu, 12 Dec 2019 12:37:23 +0000 > Commit 2ac061ce97f4 ("xen/netback: cleanup init and deinit code") > introduced a problem. In function xenvif_disconnect_queue(), the value of > queue->rx_irq is zeroed *before* queue->task is stopped. Unfortunately that > task may call notify_remote_via_irq(queue->rx_irq) and calling that > function with a zero value results in a NULL pointer dereference in > evtchn_from_irq(). > > This patch simply re-orders things, stopping all tasks before zero-ing the > irq values, thereby avoiding the possibility of the race. > > Signed-off-by: Paul Durrant Please repost this with an appropriate Fixes: tag. And then you can removed the explicit commit reference from the log message and simply say "The commit mentioned in the Fixes tag introduced a problen ..."