Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp3078719imb; Mon, 4 Mar 2019 23:51:38 -0800 (PST) X-Google-Smtp-Source: APXvYqzSBKMMi8iWhCiyFgF4PYHqufQsoiGEhE16XN2oTyi96KJmWQoSQBZMOBMBVmQdBdt12Ob+ X-Received: by 2002:aa7:82d7:: with SMTP id f23mr592761pfn.114.1551772298227; Mon, 04 Mar 2019 23:51:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551772298; cv=none; d=google.com; s=arc-20160816; b=QqSNevfDnXq70/yOe5hWYqJIXkodyFLFauluYZY7M4MUShjehjZlCgSZYtx1nffjQw VpF16lHseuGJ1Yw4b5GLxzf3tLUxwcEqbfkCbwHjTktBHXUc8FiSKuSS9DbTwnRxFHfo Zy+095C8uKHjwxRaCsrII6jy9ZVO+lO9rE+iI3oqW5XiZzZh4sf8rKQUPXSV94tB0/7q EASOCGEinoO8AVtvnX59TTfRsolEPACEH5/V0JMn4EQyyehVAIwLIq3dLchSJO3TChYD we0cgBuzEvVKnKXmZ2P8mkod0HmTEbmLX1x11ennlg4knNdj1rnDGLyLBacE8AlcbzI8 4N6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=vGxkzNFi32YNEmyF1SWEwggqFSdVpxap6plubpH4mrs=; b=mptXGcT3pe8s0SJVgVBlfsFQNMfLDWb/YaK+OzIJe1WgJtOGDCjJtXW3sabm0CxUlM Zy+6oY3lwSA+TWxp2lVYsMe6Q1SdBNO/rEh6ddFygC20au147rHcmjIsmbVUETRFKB4s Sx97x64lHYj4Ol7nKUpohDVab7YBQ3zxrLIwjU1cAye1jbQTAWJ2xh8c9cT8q2lTFZYr BKGHuTh0FxBJqQPEzbxN+0iTvn8mrJkQXROI7seE55hjfD2/bKqdxwmy+Unwm6dnsyIM kVMJVe+2cDdtPU3ogsmL+pmqtkdjT4vVLNMJgCBrj8wUQB+lcvwQ9jYmhYcXf75BmTrl zi3g== 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 u69si7311685pgd.161.2019.03.04.23.51.22; Mon, 04 Mar 2019 23:51:38 -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 S1727219AbfCEHtt (ORCPT + 99 others); Tue, 5 Mar 2019 02:49:49 -0500 Received: from mail-vk1-f195.google.com ([209.85.221.195]:36102 "EHLO mail-vk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727190AbfCEHts (ORCPT ); Tue, 5 Mar 2019 02:49:48 -0500 Received: by mail-vk1-f195.google.com with SMTP id v131so1757846vkd.3 for ; Mon, 04 Mar 2019 23:49:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vGxkzNFi32YNEmyF1SWEwggqFSdVpxap6plubpH4mrs=; b=dwsJkI3HeVNTcKMNvfAYTngi8cZm5gelz8gaaSlp5icg/v31RxMiua6RX/GD21visG WMwndYyEkfm2iOKPaTwfNxqDmB+HC6P88SSpJWI0mdJeKYz/g+BN9bc3pOUUtZRcbl/Y 0ik+NsPb3n1WLF1uxFC0gTGTDGXZUe+kl9u8OVgBde0njfHtNIT1GtKwR8d21Tw8On9B KeWSVUz7Ekzwm84DFSh7jJPp+R08XIxmNGEE5rHLknc0KTOdmutuOBgm7OKlL5iZPZcP nehGQt+cUrD9eLXelsoaZtIP8DwcsbscRLN0zQBp2to8k6WHyY11EVyZ0sw0lzCtkuNY /vfw== X-Gm-Message-State: APjAAAXS6zc9yIFd9St9NGRrM67nfIuPBOAshjU6DvkPn+T2YBAsA8JR oFCv6WxFHBgeJiT/eQXy8ZBzybv1zz2W2yZFWkU= X-Received: by 2002:a1f:711:: with SMTP id 17mr12649292vkh.65.1551772187790; Mon, 04 Mar 2019 23:49:47 -0800 (PST) MIME-Version: 1.0 References: <201903042049.npxcZzps%fengguang.wu@intel.com> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 5 Mar 2019 08:49:35 +0100 Message-ID: Subject: Re: [m68k:master 1174/1174] arch/m68k/include/asm/string.h:72:25: warning: '__builtin_memcpy' forming offset 8 is out of the bounds [0, 7] To: Finn Thain Cc: kbuild test robot , kbuild-all@01.org, linux-m68k , Arnd Bergmann , Linux Kernel Mailing List 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 Hi Finn, On Tue, Mar 5, 2019 at 3:58 AM Finn Thain wrote: > On Tue, 5 Mar 2019, Finn Thain wrote: > > Looks bogus to me. > > > > If you change memcpy to __builtin_memcpy, then we avoid the macro and the > > warning changes to, > > > > ./include/linux/string.h:456:3: warning: '__builtin_memcpy' forming offset [7, 8] is out of the bounds [0, 6] [-Warray-bounds] > > __builtin_memcpy(dest, src, dest_len); > > > > The compiler has nothing to complain about here. dest is known to be > > id->fr and dest_len is known to be sizeof(id->fr). > > > > The error message indicates that gcc has applied the bounds [0, 6] to dest > > when in fact those are the bounds for src. > > > > My mistake. GCC is right, it seems memcpy will read past the end of > "5.0.0+". But only if the else branch is taken, which is not the case. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds