Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3332786ybg; Fri, 25 Oct 2019 02:33:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqweIUL00eFg3yz+PXU4Xtd5biqylzXdOpVKaPCY2eMQMRAzyF9xphvNS/Qe1YWF9rBbukYe X-Received: by 2002:a17:906:1d45:: with SMTP id o5mr2488305ejh.250.1571996001338; Fri, 25 Oct 2019 02:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571996001; cv=none; d=google.com; s=arc-20160816; b=S97jt8HOTwj/ZzQ6LS7Cic+Rx3sh+3BT2Fo5QxVOoHBSz7wan3PhLXhq6HFpjhRSB5 5UqLRFLygdd4DqjGp/fuYPCwjbHUzymwQaSpWEY+/a/lviaIr4QbnjNavHxPnq4R4ekP dl2aS6AW7fr0lXk2ozbmVG2xk11FRxfqhRSry/ifl1KWmDa5jFPjgyAeL/IlxtL/H9de SVzBOSciuXRjCOFzhv3Lz8KG/Yk0Kxqhk1ttOIIV22anVRHjg84ZL8LvopeXA2BniIuH GfP3hpezEvddfvQu94bTzCYCdH4sqJLLBk68WknoFo/jM44RnfDwYed01bwSzlKErbV6 n4CA== 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:message-id:subject:cc :to:from:date; bh=BQN5YEfxzFBu1VDs8Sn/nH0XIH4nsjbNnDabUtp1jzM=; b=mas/mad3NY1HRM/JajY4ccmfjJ13dAzdH6iJUjFjysxlYaZmui9BxAqtBKWJwdF+dH iSPbvOFSkHEY7NXQX13Fuwhgp5evi9sByH8fXJ23yysGbNwFpuqRf/+s3V8kE5/WiyGv AMTyfmizVLG5ez4ANyOO7l14YQAS/ryfok5ScCyun5HTZ4hkOjtiUCdaSu/A9HHxzmVK zMdkHpvHyNrkcyUWlB3TR5Phy/M5C21lgFi8Et+wIPYW/FvOcRMcNsi0sPhKkA3VJbTE y+LFGt2+g3Yf08qJYgAAnDBcDqEouZ2ybRjczAtmY0AteotFtprpzPh1+5fi2dZ3zlW7 wqOQ== 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 v13si1115079edb.164.2019.10.25.02.32.57; Fri, 25 Oct 2019 02:33:21 -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; 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 S2409163AbfJXKbi (ORCPT + 99 others); Thu, 24 Oct 2019 06:31:38 -0400 Received: from a.mx.secunet.com ([62.96.220.36]:43424 "EHLO a.mx.secunet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389949AbfJXKbh (ORCPT ); Thu, 24 Oct 2019 06:31:37 -0400 Received: from localhost (localhost [127.0.0.1]) by a.mx.secunet.com (Postfix) with ESMTP id 04D892052E; Thu, 24 Oct 2019 12:31:36 +0200 (CEST) X-Virus-Scanned: by secunet Received: from a.mx.secunet.com ([127.0.0.1]) by localhost (a.mx.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DZEo1hkksutq; Thu, 24 Oct 2019 12:31:35 +0200 (CEST) Received: from mail-essen-01.secunet.de (mail-essen-01.secunet.de [10.53.40.204]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a.mx.secunet.com (Postfix) with ESMTPS id 4828E20189; Thu, 24 Oct 2019 12:31:35 +0200 (CEST) Received: from gauss2.secunet.de (10.182.7.193) by mail-essen-01.secunet.de (10.53.40.204) with Microsoft SMTP Server id 14.3.439.0; Thu, 24 Oct 2019 12:31:35 +0200 Received: by gauss2.secunet.de (Postfix, from userid 1000) id CB32731801C0; Thu, 24 Oct 2019 12:31:34 +0200 (CEST) Date: Thu, 24 Oct 2019 12:31:34 +0200 From: Steffen Klassert To: Tom Rix CC: , , , , Joerg Vehlow Subject: Re: [PATCH v2 1/1] xfrm : lock input tasklet skb queue Message-ID: <20191024103134.GD13225@gauss3.secunet.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-EXCLAIMER-MD-CONFIG: 2c86f778-e09b-4440-8b15-867914633a10 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 22, 2019 at 05:22:04PM -0700, Tom Rix wrote: > On PREEMPT_RT_FULL while running netperf, a corruption > of the skb queue causes an oops. > > This appears to be caused by a race condition here > __skb_queue_tail(&trans->queue, skb); > tasklet_schedule(&trans->tasklet); > Where the queue is changed before the tasklet is locked by > tasklet_schedule. > > The fix is to use the skb queue lock. > > This is the original work of Joerg Vehlow > https://lkml.org/lkml/2019/9/9/111 > xfrm_input: Protect queue with lock > > During the skb_queue_splice_init the tasklet could have been preempted > and __skb_queue_tail called, which led to an inconsistent queue. > > ifdefs for CONFIG_PREEMPT_RT_FULL added to reduce runtime effects > on the normal kernel. Has Herbert commented on your initial patch, please fix PREEMPT_RT_FULL instead. There are certainly many more codepaths that take such assumptions. You can not fix this by distributing a spin_lock_irqsave here and there.