Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp619436img; Mon, 18 Mar 2019 10:23:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwu8vk7bLiPAFGkLnbAKVAeIHUWECyPaU2uCF+8D7nQKinM2JNXmUrCvWJ0YNHZxEAfH9TW X-Received: by 2002:a63:29c3:: with SMTP id p186mr18786397pgp.24.1552929823485; Mon, 18 Mar 2019 10:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552929823; cv=none; d=google.com; s=arc-20160816; b=jcos4VrIFmKaB5gBxwW1e2rrak89B7qNSaracV2FVWtCpEcOYnmnUM0N2Sy3keOnwT voo29Nm4wtUtnrShkKywa2zwG//ypdldqZlU0MUtcS+ukrTs+R6WuHBdsqU/kw1wzMwI AWX+sER6w8VisK+RCH7zRS+DU/0DyaCfAs1Eftas6aEIJsqCpUYBkkLZqs3eHLIFWtU+ x9kcrj9p4FcCtFvSxswSf9KlnWLvlQGDBVuDzQtrUHcp60Iz7q3hfslxf1nzQrMWSctU njLyH1fpTqWl7e7fG+6RsS22YK/0DA8i8GPNSzjHAyo3HBYy8cuYxN9L0BZI6/PLXO4V OTAw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=CPXlzC3Qw3vb1vwaN6qwSjYHpa7TmPwsAtN0D0aIOMo=; b=ZKjE3DDOOO8dvRox1zzMJ32s9eoT1auug05L7LyBSqD1HNG29gnDl55Cd++bzwW1Cg wZqOsPJFw2ReRBRfnE61Z4imoqPDzA3f9wpcxSGoJyQxPgATnTZcCTgIbBo3DMmSrz/H 5iSW/RkcW2HpUiDuCv36rUpREHdDZvBkkXIGFvg8SOoPxMArXRY/iZbR9u1kAY5k7fFZ sl1XYwQIHnQDnYokoG7RlQbgqIcvYLC121no6uf/6l+HKOEZwx3mi14gzqTCEKpxzXOH NObmsoYG0Je49zHJrrFXOcwW8QuB/9DnAH+PXHVD7xIvWvYjFuHN78YEvGMWQFcdhLY3 w30Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mAra5kYk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k4si7983590pgq.288.2019.03.18.10.23.27; Mon, 18 Mar 2019 10:23:43 -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=pass header.i=@gmail.com header.s=20161025 header.b=mAra5kYk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbfCRRWv (ORCPT + 99 others); Mon, 18 Mar 2019 13:22:51 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40190 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfCRRWu (ORCPT ); Mon, 18 Mar 2019 13:22:50 -0400 Received: by mail-wm1-f66.google.com with SMTP id u10so11214523wmj.5; Mon, 18 Mar 2019 10:22:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CPXlzC3Qw3vb1vwaN6qwSjYHpa7TmPwsAtN0D0aIOMo=; b=mAra5kYkbq2DRq/QHrHQj9tgXw2hKQ+Vdmy4yx+fsBSFv7n7J3l8fwaWmK9zOAC0cP HRu92PmKUD8LryYeWDTtcGWRE/iUQI4qSFPuiuib7zxXjIgtmffXnF0z+sOpGDrCbDrk 5iD82XWF5XJuH3RjPy/4z3ETnn5qUnKXlsdrO5olrf+QXhk95onXStYLT54Wg4ur0trg Mhw4WJWbht0PCct81g7yb4oQCO+bOfugPhTeSykzbHcOoKpdTgU2QeApDeinijp62erU wFftVKio56kINCYIfgSJgyvDmTIZwyOxhS+hmPC8hwI3PbSAku7kb/3CKJlxC+2bMKWa yyFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CPXlzC3Qw3vb1vwaN6qwSjYHpa7TmPwsAtN0D0aIOMo=; b=etzQyIag62wHrDexwKRaG//ffrRcEjDJgJtmfUfCxFOHpudw8uPpnSnRrN7k1iGhWW hlR9+UW++S1mp67wADWaT7+ZX6+JTh67ysSwbUYJsO0RmV9vdoRTxYVaFolN5dYPwlv4 Pyff27eMVEVfQ2Ij6KkOOiQBP36oOjvC/Z1O6tYc0ExsS0mxknkHYwXUNQXaMSKtXTNY 0vP8uQY7chn1ANhk0TMYx5lFo/7d9EJw5f5wL6/6uYwGvC/9TB8aUqCvAylPUh9hDPPL BMaALBnlHanny+8Y8vWwUAtIRNKKZRdzp9gQYmNIEHX0H2xlkcAF938jHDCGU71m9+9E ePcA== X-Gm-Message-State: APjAAAUeHjyF2WLYBfJYLEuYYarBof3HNSfB+wbtLhiDek9YylRqFwms Ik+MAPy7AChxi58TNP2430z7Zoy1 X-Received: by 2002:a1c:f610:: with SMTP id w16mr3416wmc.42.1552929768645; Mon, 18 Mar 2019 10:22:48 -0700 (PDT) Received: from [172.31.96.190] ([195.39.71.253]) by smtp.gmail.com with ESMTPSA id w13sm10918961wrr.21.2019.03.18.10.22.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Mar 2019 10:22:47 -0700 (PDT) Subject: Re: [PATCH v3] net: xfrm: Add '_rcu' tag for rcu protected pointer in netns_xfrm To: Steffen Klassert , Su Yanjun Cc: davem@davemloft.net, fw@strlen.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1551923648-17656-1-git-send-email-suyj.fnst@cn.fujitsu.com> <20190311101006.GK3758@gauss3.secunet.de> From: Eric Dumazet Message-ID: Date: Mon, 18 Mar 2019 10:22:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20190311101006.GK3758@gauss3.secunet.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/11/2019 03:10 AM, Steffen Klassert wrote: > On Wed, Mar 06, 2019 at 08:54:08PM -0500, Su Yanjun wrote: >> For rcu protected pointers, we'd better add '__rcu' for them. >> >> Once added '__rcu' tag for rcu protected pointer, the sparse tool reports >> warnings. >> >> net/xfrm/xfrm_user.c:1198:39: sparse: expected struct sock *sk >> net/xfrm/xfrm_user.c:1198:39: sparse: got struct sock [noderef] *nlsk >> [...] >> >> So introduce a new wrapper function of nlmsg_unicast to handle type >> conversions. >> >> This patch also fixes a direct access of a rcu protected socket. >> >> Fixes: be33690d8fcf("[XFRM]: Fix aevent related crash") >> Signed-off-by: Su Yanjun > > Patch applied, thanks! > Has this patch ever been tested ? I do not see the needed rcu_read_lock() / rcu_read_unlock() that are mandated for rcu_dereference() correctness. All changes like that should be tested with : CONFIG_LOCKDEP=y CONFIG_PROVE_RCU=y