Received: by 10.223.185.111 with SMTP id b44csp920681wrg; Fri, 9 Mar 2018 16:54:47 -0800 (PST) X-Google-Smtp-Source: AG47ELstqBqHMpPDp/zmvo1hdGwb37oVA2F7elvOQaT4F2B2wigpD6WowG/SY7B2+hS0fYo8HKmd X-Received: by 10.98.67.216 with SMTP id l85mr381587pfi.214.1520643287807; Fri, 09 Mar 2018 16:54:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520643287; cv=none; d=google.com; s=arc-20160816; b=H0FyBujFMllB9gdo4zDT7Nb6zNRFKBa3ZrWM4MGNqOqSZV2+6c8m0gvrms5IgvN9Vo qn8wsxVtLwFcvjTrAXDbu3qfV4yDjJTERUCCgox6apzQUnB/H9npFTnuMiYVmc08j8qv fmNqzhfqyga4FPJIJUFHyPH9veqmSksEFc7vjrPVYIjcFtIoA6+vLuF2h+QhuHWwrcn2 2rY5mUsXF3ECF8BssXbTGcguKYdAjSG0N5sEmm/zU9WO/NrLjs07ENh8LnssiT15gP6Z uNNNPwiQM/sgzN7QmRbhHplgHujjiGZ/fpPiSw/zIP2a2Ob0VNjEWoFglaIwkzjmWTjD 3BJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Nu3Kx167gPe1KKRKku2bplvrsedp5LxUGfXXtzm76rk=; b=KD0e1SYm6Kb6NHwIKcaItcawIruZ3fnzRnPZ2sMplkSnQRjrknoXg0PS1WJasMXUEY SuUBYc8J/rAeC+U1Mbxdq2Re4keYBxor7ZKRWduVBMGZ1gqr7Zp2b97yvH97MmDEfysX xaj9QaYGrFMVEHbeSLhmqnxpZjQVyz/5C7A6cWHNpQBjfAPA4I7Fs99smZUWyFuhTuhx l+NEm5xIUnur6fkKOHsoBZNPz/bUaJmHMFF5OvYF8eiiMC8xMSrCe1/2DNucwzRdcsjd vxU+9niEQmpdp26o/YMJB8haE8bnbJHpxOLhQrplDtHvlNWEwnsvxo5LJaAbq5STxbeJ twRw== 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 x3si1513342pgr.279.2018.03.09.16.54.33; Fri, 09 Mar 2018 16:54:47 -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 S932976AbeCJAxd (ORCPT + 99 others); Fri, 9 Mar 2018 19:53:33 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:38390 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932556AbeCJASx (ORCPT ); Fri, 9 Mar 2018 19:18:53 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9BE6CE25; Sat, 10 Mar 2018 00:18:52 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Sebor , Arnd Bergmann , "David S. Miller" Subject: [PATCH 3.18 10/21] ipv6 sit: work around bogus gcc-8 -Wrestrict warning Date: Fri, 9 Mar 2018 16:18:32 -0800 Message-Id: <20180310001801.631686321@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180310001801.045114869@linuxfoundation.org> References: <20180310001801.045114869@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit ca79bec237f5809a7c3c59bd41cd0880aa889966 ] gcc-8 has a new warning that detects overlapping input and output arguments in memcpy(). It triggers for sit_init_net() calling ipip6_tunnel_clone_6rd(), which is actually correct: net/ipv6/sit.c: In function 'sit_init_net': net/ipv6/sit.c:192:3: error: 'memcpy' source argument is the same as destination [-Werror=restrict] The problem here is that the logic detecting the memcpy() arguments finds them to be the same, but the conditional that tests for the input and output of ipip6_tunnel_clone_6rd() to be identical is not a compile-time constant. We know that netdev_priv(t->dev) is the same as t for a tunnel device, and comparing "dev" directly here lets the compiler figure out as well that 'dev == sitn->fb_tunnel_dev' when called from sit_init_net(), so it no longer warns. This code is old, so Cc stable to make sure that we don't get the warning for older kernels built with new gcc. Cc: Martin Sebor Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83456 Signed-off-by: Arnd Bergmann Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/ipv6/sit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c @@ -176,7 +176,7 @@ static void ipip6_tunnel_clone_6rd(struc #ifdef CONFIG_IPV6_SIT_6RD struct ip_tunnel *t = netdev_priv(dev); - if (t->dev == sitn->fb_tunnel_dev) { + if (dev == sitn->fb_tunnel_dev) { ipv6_addr_set(&t->ip6rd.prefix, htonl(0x20020000), 0, 0, 0); t->ip6rd.relay_prefix = 0; t->ip6rd.prefixlen = 16;