Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752562AbdGGOGG (ORCPT ); Fri, 7 Jul 2017 10:06:06 -0400 Received: from mail.parknet.co.jp ([210.171.160.6]:49699 "EHLO mail.parknet.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbdGGOFG (ORCPT ); Fri, 7 Jul 2017 10:05:06 -0400 X-Greylist: delayed 1182 seconds by postgrey-1.27 at vger.kernel.org; Fri, 07 Jul 2017 10:05:06 EDT From: OGAWA Hirofumi To: Meelis Roos Cc: Linux Kernel list Subject: Re: namei_vfat.c array subscript is above array bounds References: Date: Fri, 07 Jul 2017 22:45:12 +0900 In-Reply-To: (Meelis Roos's message of "Fri, 7 Jul 2017 12:35:48 +0300 (EEST)") Message-ID: <8760f4pdhz.fsf@devron> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2328 Lines: 45 Meelis Roos writes: > I do not know if this is old or new, just noticed it scrolling by while > compiling current 4.12+git on 32-bit x86. Which version of compiler? Well, latest change of namei_vfat.c is Sep, 2016. And I can't reproduce it by "gcc version 6.3.0 20170516 (Debian 6.3.0-18)". > CC [M] fs/fat/namei_vfat.o > In file included from ./arch/x86/include/asm/string.h:2:0, > from ./include/linux/string.h:18, > from ./include/linux/bitmap.h:8, > from ./include/linux/cpumask.h:11, > from ./arch/x86/include/asm/cpumask.h:4, > from ./arch/x86/include/asm/msr.h:10, > from ./arch/x86/include/asm/processor.h:20, > from ./arch/x86/include/asm/cpufeature.h:4, > from ./arch/x86/include/asm/thread_info.h:52, > from ./include/linux/thread_info.h:37, > from ./arch/x86/include/asm/preempt.h:6, > from ./include/linux/preempt.h:80, > from ./include/linux/spinlock.h:50, > from ./include/linux/seqlock.h:35, > from ./include/linux/time.h:5, > from ./include/linux/stat.h:18, > from ./include/linux/module.h:10, > from fs/fat/namei_vfat.c:18: > fs/fat/namei_vfat.c: In function ‘vfat_add_entry’: > ./arch/x86/include/asm/string_32.h:74:16: warning: array subscript is above array bounds [-Warray-bounds] > *((char *)to + 4) = *((char *)from + 4); > ~~~~~~~~~~~~^~~~ > ./arch/x86/include/asm/string_32.h:74:16: warning: array subscript is above array bounds [-Warray-bounds] > ./arch/x86/include/asm/string_32.h:78:17: warning: array subscript is above array bounds [-Warray-bounds] > *((short *)to + 2) = *((short *)from + 2); > ~~~~~~~~~~~~~^~~~ > ./arch/x86/include/asm/string_32.h:78:17: warning: array subscript is above array bounds [-Warray-bounds] > ./arch/x86/include/asm/string_32.h:82:15: warning: array subscript is above array bounds [-Warray-bounds] > *((int *)to + 1) = *((int *)from + 1); > ~~~~~~~~~~~^~~~ > ./arch/x86/include/asm/string_32.h:82:15: warning: array subscript is above array bounds [-Warray-bounds] -- OGAWA Hirofumi