Received: by 10.192.165.148 with SMTP id m20csp530189imm; Wed, 25 Apr 2018 03:45:50 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+ECf+NiYP6LqYIkAcE0QcSsGF5/UbXTVn1GZk2o4dbxw9kRHHXV/oGjuO/PjXJdV9mB52Y X-Received: by 2002:a17:902:6a10:: with SMTP id m16-v6mr28275365plk.370.1524653150338; Wed, 25 Apr 2018 03:45:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524653150; cv=none; d=google.com; s=arc-20160816; b=KRsKatYZdyE84t63QmKXdj1Ts4p5BidWAuN+YRnzvgSWVS55EMOg5hkveyC2dzma1K ngUJsVR5fVxUTOqqsRnboukkyKa4TChgMksBWLbIxWoNwId37paDb+tO0xw6glQ5fyOl 4QjjgImYs+DQCP9zJLTvpzzg72a28858ajvK/iqb+QPCaTQN0rk8c+/n9SHIeR/rj3v1 9I1O26oqGa9kicAWemMl1UQSgL3eVZlgzi+HZvBKC2p7afxvRuc2riD9FZxea+YNHkfV Q1q/IYm7p9uFNHACLUZXmemQeyAV6BEI4R6keW9yBu4zRLaTW2EeKVcXHEteL5yslP7P Okaw== 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=8ujskl5/V7dn6FXonOUsKQvFFqKWn3y4UOyxp7de7KY=; b=mabfFf8F04Pe6dxd3+PeQYM1Q2ngjnVQ0Tuqcs63t7G7NuZ5UQiNKEuaP7L/hjUpL3 nRmDGQIlc53e0KhrsCwk5LG4SLxosMGcq6r/02ESyBLPmILWkp0LoTH13tSACRnnFR0z R4MLckyit1z21BsL4txTEOOz4ZeImSF6xHTn4kF6Rpg+HnRNfeTjl1wlYCv8nGc9jNk5 e0XwZWQgAz6i/cmxTm7mRgTUcFIm3qRVfQzYm1/CG71+4J6cWXrCkpdg40P3LBVMRkvW j5F5Mt6q1nqe0vGmcuvxFskx+8ey3yLCzI+L75Sa/tPw5iez5eYT2xK5Ef1JpF/XtZgn ch0Q== 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 bg11-v6si16197731plb.171.2018.04.25.03.45.35; Wed, 25 Apr 2018 03:45:50 -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 S1754324AbeDYKoO (ORCPT + 99 others); Wed, 25 Apr 2018 06:44:14 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53210 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754110AbeDYKoE (ORCPT ); Wed, 25 Apr 2018 06:44:04 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 43E88266; Wed, 25 Apr 2018 10:44:03 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Steve French , Sasha Levin Subject: [PATCH 4.14 146/183] cifs: silence compiler warnings showing up with gcc-8.0.0 Date: Wed, 25 Apr 2018 12:36:06 +0200 Message-Id: <20180425103248.409714351@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Arnd Bergmann [ Upstream commit ade7db991b47ab3016a414468164f4966bd08202 ] 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: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/cifs/cifssmb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -6331,9 +6331,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;