From patchwork Thu Mar 8 09:29:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Abeni X-Patchwork-Id: 883008 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zxldy0ykGz9shQ for ; Thu, 8 Mar 2018 20:32:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755605AbeCHJcD (ORCPT ); Thu, 8 Mar 2018 04:32:03 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:35742 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755537AbeCHJb6 (ORCPT ); Thu, 8 Mar 2018 04:31:58 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34FEA8182D0A; Thu, 8 Mar 2018 09:31:58 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.32.181.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 43D7A215CDAA; Thu, 8 Mar 2018 09:31:57 +0000 (UTC) From: Paolo Abeni To: netdev@vger.kernel.org Cc: "David S. Miller" , Mahesh Bandewar , Jiri Benc Subject: [PATCH net-next] ipvlan: properly annotate rx_handler access Date: Thu, 8 Mar 2018 10:29:30 +0100 Message-Id: <3eef25d5e0b41aa3429ba31f87264c17e75de9e6.1520500821.git.pabeni@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 08 Mar 2018 09:31:58 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Thu, 08 Mar 2018 09:31:58 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'pabeni@redhat.com' RCPT:'' Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The rx_handler field is rcu-protected, but I forgot to use the proper accessor while refactoring netif_is_ipvlan_port(). Such function only check the rx_handler value, so it is safe, but we need to properly read rx_handler via rcu_access_pointer() to avoid sparse warnings. Fixes: 1ec54cb44e67 ("net: unpollute priv_flags space") Signed-off-by: Paolo Abeni --- drivers/net/ipvlan/ipvlan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ipvlan/ipvlan.h b/drivers/net/ipvlan/ipvlan.h index c818b9bdab6e..adb826f55e60 100644 --- a/drivers/net/ipvlan/ipvlan.h +++ b/drivers/net/ipvlan/ipvlan.h @@ -180,7 +180,7 @@ int ipvlan_link_register(struct rtnl_link_ops *ops); static inline bool netif_is_ipvlan_port(const struct net_device *dev) { - return dev->rx_handler == ipvlan_handle_frame; + return rcu_access_pointer(dev->rx_handler) == ipvlan_handle_frame; } #endif /* __IPVLAN_H */