Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp627027pxb; Mon, 25 Oct 2021 15:17:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF1XuliRKVDDzqZnZhbDRY8du/dGjGIhX5xXrNYNzOVfjy8BAJc9J6sZ+GhgHmwSYYjCJL X-Received: by 2002:a17:902:7b84:b0:13b:90a7:e270 with SMTP id w4-20020a1709027b8400b0013b90a7e270mr18707497pll.21.1635200261414; Mon, 25 Oct 2021 15:17:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635200261; cv=none; d=google.com; s=arc-20160816; b=aPXqZu/d3DeHZY/IAdmhJ0krggpHuhLTZp2ed+IapNwuMPc9oqAbP16x5ISMbbrzn+ TNRxLY8JfxKWzXuourdUvwCwWGKZPtFpb117D6BTSyx6O3G0tQ+zLN9tDk3NtjMDpG2T IHJW3IQQSsF7tB8EZedqrsmjziOG8m4AlmQksOLLKDbDllFf+6TOmMiuw1G/kyvqgCK0 M2yUF4kMRFgYyakBazDxYlXH5APRZ6o000mDxcZ7LumkLq6mgUuVYGTtfhscINQ5s13m HXTkzlaxOux1MS89josMkr81oyN5ZcK13SZttdQetxcqBRV4K9qIDmKuaFMn6ENClT9r KA3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0CDdWfImgCwkzZq8gb4MHFDeuH8ceNVaoE0MsSBltok=; b=mAEKTbcHoaeWVg9pM42B4GUGJz/ulkWZFTAXvKuM0YtQT7EJX/8WjmSW/mjuWmbIrH 5HABWNdPEPpetNs2uvrkpawSpi2nmBDJONsYl2mgnFpP2J6W/4aN9y/kSktNhbcnn2qb EabzWHhD99k+bhYcptQAGa3VBPotqiOMaC5RYaX9e+4FUuv8YSQKDB+Okgo3c35tQrOi D1UKxt4rq5gZvQ98QzL6sNcpNNQ9boLSHel63prw0S2r/KcAw5frQSo48QAZk131WMCl kBzfZiJiU/LeJTn27gLwB6pDGvunfogFw0lAFVmveUjdvRHTLGx9C6FmAdKEJ6Qw38oQ +s8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a0bGH9qB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y65si8786856pgd.199.2021.10.25.15.17.27; Mon, 25 Oct 2021 15:17:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=a0bGH9qB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234151AbhJYTRa (ORCPT + 99 others); Mon, 25 Oct 2021 15:17:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:34910 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234076AbhJYTR1 (ORCPT ); Mon, 25 Oct 2021 15:17:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD50960F70; Mon, 25 Oct 2021 19:15:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635189304; bh=b+xl18K2r7wCrKPaIjRbfIwPrWB2N8hUVu8rcUYCGeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a0bGH9qBCW2/UWrlEP036+E+lu5KgP7UOeTD+YB0T4PPxemKhHdSkyuk6Z+VNfOsc 7+WMipbTzl77TcvIiH381G+HKazYCIDies0Y5SFwaI+BF8X2Fb0kPwjLHGL66N7/Y5 GYP7Cl9AsKBMabihUdCN+gs2YdNp2X3EF2pGePfs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Jakub Kicinski Subject: [PATCH 4.4 16/44] ethernet: s2io: fix setting mac address during resume Date: Mon, 25 Oct 2021 21:13:57 +0200 Message-Id: <20211025190932.047691106@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211025190928.054676643@linuxfoundation.org> References: <20211025190928.054676643@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann commit 40507e7aada8422c38aafa0c8a1a09e4623c712a upstream. After recent cleanups, gcc started warning about a suspicious memcpy() call during the s2io_io_resume() function: In function '__dev_addr_set', inlined from 'eth_hw_addr_set' at include/linux/etherdevice.h:318:2, inlined from 's2io_set_mac_addr' at drivers/net/ethernet/neterion/s2io.c:5205:2, inlined from 's2io_io_resume' at drivers/net/ethernet/neterion/s2io.c:8569:7: arch/x86/include/asm/string_32.h:182:25: error: '__builtin_memcpy' accessing 6 bytes at offsets 0 and 2 overlaps 4 bytes at offset 2 [-Werror=restrict] 182 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) | ^~~~~~~~~~~~~~~~~~~~~~~~~ include/linux/netdevice.h:4648:9: note: in expansion of macro 'memcpy' 4648 | memcpy(dev->dev_addr, addr, len); | ^~~~~~ What apparently happened is that an old cleanup changed the calling conventions for s2io_set_mac_addr() from taking an ethernet address as a character array to taking a struct sockaddr, but one of the callers was not changed at the same time. Change it to instead call the low-level do_s2io_prog_unicast() function that still takes the old argument type. Fixes: 2fd376884558 ("S2io: Added support set_mac_address driver entry point") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20211013143613.2049096-1-arnd@kernel.org Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/neterion/s2io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/neterion/s2io.c +++ b/drivers/net/ethernet/neterion/s2io.c @@ -8625,7 +8625,7 @@ static void s2io_io_resume(struct pci_de return; } - if (s2io_set_mac_addr(netdev, netdev->dev_addr) == FAILURE) { + if (do_s2io_prog_unicast(netdev, netdev->dev_addr) == FAILURE) { s2io_card_down(sp); pr_err("Can't restore mac addr after reset.\n"); return;