Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2246146imm; Thu, 7 Jun 2018 07:38:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJmbp6L0c9nWpaUmT3XqMWNkEOB+Jq4T2bfPeaJbie3nzPbegKaZtbohddZQVADAjTmFGXY X-Received: by 2002:a17:902:6ac7:: with SMTP id i7-v6mr2326502plt.288.1528382336061; Thu, 07 Jun 2018 07:38:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528382336; cv=none; d=google.com; s=arc-20160816; b=ozYeRBdm+DkCGOOPY1NU5OLq1wDT2KBhydf9e0DtTp0Gk9RDpyjPFVljss34MY6Qe4 z2wjNAHW1dQQbeKxwvg9/jH7Wm3F2ni8HbIXPQmFaYEGTwc74ExDLE4b95llH3HXBTAb 0bdIlyLaWuUcKFgYZsxM+uSomlxoGGtLWGjPZGWofbHSPiCWxU5Axeh44h9Gx1UtreX9 n3+mKE/kcdpWTTa8EITq9+aVRg77q5ORBF/vFXJ9M5jI4AG9Jzk2cnRbVYJZsLVKGoAU JTbWZ+rgMz1V2ISQ/zKww8AO2EdYQefwsVxnixWkWA066oRF93/2LK5BPsVzUaG+DyAL AsSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=Xuh6FPZkHNRJmSJyPlx+Pjhd1kEMcqGAoeaNyjiixnY=; b=MJqVg5B7oW5P2B+4O/phe1sJIfUVUDEu6qmd/x6CzDxD0XUF3n+52fcFN2NmMn4kVQ oVHmANzlr6Xs4Rn+zLFEuiDqV2mDWK3x5O5CRIxwO5tooMFx3i7THry08hCZH+VsX/86 yNArU9uqSgmrPoE9FFt7yw0Ljf6eBJfdzXKgh0zAMi/SpjbU589oGARmQmdB6kTCRB6f mp5nYIBZsell5yGUU4KXoNNG0nBhBbflSELJHjLkPR0aT/3YDMOiu8cyxgXmqIFrH4Gm QMfQ4pxRQKZMudGDpIqvWH1x/giol67i4Y2IuGTBPPPjmxv4Y4/ieUXZPXbZWpga4XaE bPsw== 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 p8-v6si53369849plk.441.2018.06.07.07.38.41; Thu, 07 Jun 2018 07:38:56 -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; 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 S934082AbeFGOgN (ORCPT + 99 others); Thu, 7 Jun 2018 10:36:13 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40403 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933072AbeFGOgM (ORCPT ); Thu, 7 Jun 2018 10:36:12 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbe-0005hO-DG; Thu, 07 Jun 2018 15:09:38 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb6-00031z-Nt; Thu, 07 Jun 2018 15:09:04 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Arnd Bergmann" , "Steve French" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 217/410] cifs: silence compiler warnings showing up with gcc-8.0.0 In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann commit ade7db991b47ab3016a414468164f4966bd08202 upstream. 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 Signed-off-by: Steve French Signed-off-by: Ben Hutchings --- fs/cifs/cifssmb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -6366,9 +6366,7 @@ SetEARetry: 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;