Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4802675imb; Thu, 7 Mar 2019 00:31:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzKO6H/zIR4MmKhTmfVBmqfZoGwMpgVnNG8Y6/bicGo1Ye40ScnAnsxnDSVNMOLiJJsiF7W X-Received: by 2002:a65:5c01:: with SMTP id u1mr10364319pgr.197.1551947517694; Thu, 07 Mar 2019 00:31:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551947517; cv=none; d=google.com; s=arc-20160816; b=Y6OVFSj+06ftz8WZt1WksyC7yTAhM8CWRc5hJg/aD6V/ZGGqzoj27ABYqDLzshP2Re /UB1eBrmlUfKMXHS9+TXWcYhyTcwPISvR3+jPKb9b3yDYNCXjNzeVLhDGKyXid5fat/s pc71A3neGKj5xec+bM7R/QFGMTctAYi0KRo3eOOmtAJzL/GcvN0Q3MMcGKzAtwQfk7lH nQeh7Sh36+mKah3gGpxSqop9Qv2vu4s5Ai1P0evvImW1i1h2QvrZIQEUcvSc2x9ayPDU 67UqJpfVPm/T9GXXTOthaT6ynGNF5Ppwqx7EdY+16rSEvoAhSmBV8m/ZGApnHzh1jP/t 5+5Q== 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=gb4KXmP16O/0dsL+aVHbdGKiNn6WELO1QnvnFFFXLJs=; b=0Wkszxexzkc0hiWceSdg5fE972zFM7GdkuxBlAKLiAlEfG2mZrs5Pfg3TAX8PUWMwa 6zaZudqL6omYs1VeT2eG1M6Z748ZVFddTiTZcOm2zM1Q2sgPlWKsVomnBSxxxghdfmsj E9L5UEcKg4hRf2XFfZuPKSTDPj0YljalLGEG7LzIk/nTbSwAaKnTqLRQ2KktDM+TWPzM wpR527Qu72sOic0Rsn6PN7ZSuwyIQcFfF+qpWEFABd1m7CKn4X+7GPsTFMCuw4Tb6AMN CwHcI2iz68P3MmmUZvKodk96Bnco4ZdJhzLIai6QaKD5jZxlpQckj2W68tbzVqQKlj6d ndkg== 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 k1si3444331pgg.215.2019.03.07.00.31.42; Thu, 07 Mar 2019 00:31:57 -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 S1726254AbfCGIa4 (ORCPT + 99 others); Thu, 7 Mar 2019 03:30:56 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:45534 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726101AbfCGIa4 (ORCPT ); Thu, 7 Mar 2019 03:30:56 -0500 Received: by mail-vs1-f67.google.com with SMTP id n14so3957793vsp.12 for ; Thu, 07 Mar 2019 00:30:55 -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=gb4KXmP16O/0dsL+aVHbdGKiNn6WELO1QnvnFFFXLJs=; b=cm2MhHFqubwk0SW2lcfu+lpvDp70viloCCt1/VMbOSyyVk/u/s8VhFueppW4SAJlr2 wOaZVtJ5YSB3CKeI4i0JLlIxk6IozvxUnSeDJt7IUHARmthKduvKBYIZZcbSrY8zDLtT WjP/Bd1KLm2/XmWlf959EOUav5bHKn6ZJbJXe6gjS+ry9rpemPY80eORrYa6iHd4Yo3U L/5SgxOrXYFod9dEhIH1DbIWrKsDTdXSqLErkICysiyBBBshWpomHCPsHHufnwkrCRsd L2RcxixgT69QHh50Y866RQY1OtHKT1FsSCeI+wt1vv+0m+ba7qZ8iy1i/rv4qJ1+k/Jr uLlQ== X-Gm-Message-State: APjAAAVVqaBzO7rHFnl5Bv8D8q6ExoF71ht4BTthmqzV2ZFr7IDmFlxs W3ws44w22oWGFPvMFowkx5hLfLdIOe93dcbsg18= X-Received: by 2002:a67:fc9a:: with SMTP id x26mr6326984vsp.166.1551947454837; Thu, 07 Mar 2019 00:30:54 -0800 (PST) MIME-Version: 1.0 References: <201903042049.npxcZzps%fengguang.wu@intel.com> In-Reply-To: From: Geert Uytterhoeven Date: Thu, 7 Mar 2019 09:30:43 +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: Andreas Schwab , 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 Thu, Mar 7, 2019 at 3:59 AM Finn Thain wrote: > On Tue, 5 Mar 2019, Andreas Schwab wrote: > > On Mar 05 2019, Finn Thain wrote: > > > > > interesting that the kernel's strlen implementation in > > > include/linux/string.h can't achieve this. > > > > This implementation is only available if ARCH_HAS_FORTIFY_SOURCE. > > > > I see. Perhaps we could add another definition to that file: > > #if !defined(__NO_FORTIFY) && defined(__OPTIMIZE__) && defined(CONFIG_FORTIFY_SOURCE) > ... > #else > __FORTIFY_INLINE __kernel_size_t strlen(const char *p) > { > return __builtin_strlen(p); > } > #endif > > I didn't test that. But the following patch seems to work... > > diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h > index f759d944c449..3cff6b128ed3 100644 > --- a/arch/m68k/include/asm/string.h > +++ b/arch/m68k/include/asm/string.h > @@ -71,4 +71,6 @@ extern void *memset(void *, int, __kernel_size_t); > extern void *memcpy(void *, const void *, __kernel_size_t); > #define memcpy(d, s, n) __builtin_memcpy(d, s, n) > > +#define strlen(s) __builtin_strlen(s) Shouldn't you add #define __HAVE_ARCH_STRLEN here... > + > #endif /* _M68K_STRING_H_ */ > diff --git a/lib/string.c b/lib/string.c > index 38e4ca08e757..fe970f2160e5 100644 > --- a/lib/string.c > +++ b/lib/string.c > @@ -472,6 +472,7 @@ char *strim(char *s) > EXPORT_SYMBOL(strim); > > #ifndef __HAVE_ARCH_STRLEN > +#undef strlen ... so you can drop this change? > /** > * strlen - Find the length of a string > * @s: The string to be sized 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