From patchwork Fri Feb 2 15:48:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 126743 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp759079ljc; Fri, 2 Feb 2018 07:49:36 -0800 (PST) X-Google-Smtp-Source: AH8x227prsq5B442te/X0zCQjdwQ8WCH18Dw0C65oNgIlRMlhzvRvg/RmKKwPRlsReuyhBtAC46e X-Received: by 10.101.82.134 with SMTP id y6mr2953496pgp.101.1517586576540; Fri, 02 Feb 2018 07:49:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517586576; cv=none; d=google.com; s=arc-20160816; b=Le/BXsuyzEHz68S2k3/6YFOl0EI++WPuaLds2l4/L/9mBflW3uE2McFyszSJ4Klni9 lkQW6g/YYQjE6rbSKCV1y9UtBzlnP4gHnBWQ4mSczXAEg7r7tjRBiQoNBLFKPhAt4/jy imeW7FOByubeFq0ML7+O8/UgheOZgTNrAAHPba7TBHgQsK3KirsH7gEDO5Vmuoacio5q TgXRhtEn0+IWyBryu0eV/hmR3PPLrrBLVe76HB8vXfRI1lESOpkUiXwb/dTQ94bVYBvt A3eaFUqcq65R80vnfg04cb8i6AjBtQGjSh0qpHXpZYfFPg2gZgnfRSLv0x3NFUazChZQ Sa8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YjuTmCAcIoQ50EJqy2PAFaAt72Ea9J5x/YDZX1CdqRE=; b=Pp8jYv/rwSznRaRU6oMJ8EcsKakVrVQQpRQcMQH96iQjrVNuLo77eAEiMCVOYCt2Mv QuZJ4GAyo3LKJIJvhtD7luNAGjR8beeRvzT/h7SMzWmv0MyIRi1lUMcG1kGKQVJcZOgD ozRIwaUB7U07Tn1UGIKgZGRM5isDo3KgspM0LYipCp90GA5eBi7NkvsJ3ibiOyReFvGX 9lBBuXF8Z9HeRRlVK8WncEe9rJH6G8GJF0HV4WE8NYHLF088wEM1WmarCRAeXKm42Bnr rs9eRCrUtey6VW69AcmOTrMqhszWXU9sXTc0iS5OAgY3rmWIvSBMw5dYA+sqYbep6pHq 7hBg== 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 v65si74864pgb.238.2018.02.02.07.49.36; Fri, 02 Feb 2018 07:49:36 -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 S1752239AbeBBPte (ORCPT + 28 others); Fri, 2 Feb 2018 10:49:34 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:59760 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbeBBPtY (ORCPT ); Fri, 2 Feb 2018 10:49:24 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0MYvrP-1eDmst4AxX-00Vgv6; Fri, 02 Feb 2018 16:49:05 +0100 From: Arnd Bergmann To: Steve French Cc: Martin Sebor , Arnd Bergmann , Pavel Shilovsky , Ronnie Sahlberg , Aurelien Aptel , Long Li , Samuel Cabrero , Sachin Prabhu , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Subject: [PATCH] cifs: silence compiler warnings showing up with gcc-8.0.0 Date: Fri, 2 Feb 2018 16:48:47 +0100 Message-Id: <20180202154902.1626750-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:AOn6yadvnaxLgNkAzUbHoHDgSHf92Iw5pRyEGwtckoOsr49K/lQ FGOd1WOCBVBU/QHYS1RUqZQdsP80xJKYmQdYaHwlFCcuOveTo+mIeKlbnslAWZL3Y8WYcD3 HxgJK7aoO0Z8Rm8mEFBr34Cg8tNWZVPZ3jmzEfVev1c509axCxxOvpG57vHHFxiq7n/eZlW 45mkYFmsqTeQY+MKGMWew== X-UI-Out-Filterresults: notjunk:1; V01:K0:WujVtP8/yzM=:QELPEsIW+VydDgAvBxtEVS kfW+LfZLbKT3P4upgAgIPQacCLwqXThon/EXAlhihFiXB79qBWMRol7kRo/PA/4ND7TAHDDh3 tX73S0eHmSDq9sHiiwO3QCW/4YDt70abA5YiD1FqhMaKf89yEDOMDe1aCVhCeS1zgMRLaRA5z gVr5FgMSJlyzxL9mzzPDaB8d2dib8j5wJ4i7auUv8VjWPUO9kRJCkPmXjWAqonXqmG1yiZ0S8 fBj6axasbXZRE/gLcfKkTaSkFHwUoFQEtEtTMA/93xirUKENAkmBWcBzYcrbnwsK13i5JExCu YM9Qi6Pc6F8FkeYYOV314viT6+T5zj9e6l+ctKPDCfFtQYYgAVGuqg+UVpX4Jet10oDq0JMi6 k4xC3szO46f+VZB7dwZEM0+bQbwYJoArC/lzx9AT3EkPhwSfVIWZ1Yoak5cQ9sfxs7UERGrQj zk+Uu5vGDcx1X06gHcgjhnyrF5vVeYcByrkKYkiXe7rBrmJ/5ZoeKEOShEmT9kVV+Gh65qhnB o+Pyb4dW84iUZZdp0pFxpvcw6y39v+J/XN8L1OyYSU0oCBY8CkH6SypIqLICT34nIWUqazwc4 6akhVIv2Lc24nftHA9K4vJW4aQz9Eltba2IB3UHFQAwZicm5ZIIo4iod7qDnn/MsK9OGDZNg+ RQ1gk6j1SKk1Sp6Rgp1iDKLVmCzOVfLbFk/lOxvgIJilDVpJHHjBNlkFTbMecYawpseNNPpts t0yT94EhR9o+5m+VHIqnv8Chqzq+BkHeqBl7XQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This bug was fixed before, but came up again with the latest compiler in another function: fs/cifs/cifssmb.c: In function 'CIFSSMBSetEA': fs/cifs/cifssmb.c:6362:3: error: 'strncpy' offset 8 is out of the bounds [0, 4] [-Werror=array-bounds] strncpy(parm_data->list[0].name, ea_name, name_len); Let's apply the same fix that was used for the other instances. Fixes: b2a3ad9ca502 ("cifs: silence compiler warnings showing up with gcc-4.7.0") Signed-off-by: Arnd Bergmann --- fs/cifs/cifssmb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.9.0 diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 72d71703f1e8..78bc86c315ec 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -6343,9 +6343,7 @@ CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon, pSMB->InformationLevel = cpu_to_le16(SMB_SET_FILE_EA); - parm_data = - (struct fealist *) (((char *) &pSMB->hdr.Protocol) + - offset); + parm_data = (void *)pSMB + offsetof(struct smb_hdr, Protocol) + offset; pSMB->ParameterOffset = cpu_to_le16(param_offset); pSMB->DataOffset = cpu_to_le16(offset); pSMB->SetupCount = 1;