Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5347143rwl; Tue, 11 Apr 2023 04:16:28 -0700 (PDT) X-Google-Smtp-Source: AKy350Y4VCmhcrydFd2K/kunjUFJRprPmwVlslKFVspAI5xYEyBTmvPI5r3KzkDcpoMkK2ugQstF X-Received: by 2002:a05:6402:782:b0:500:47ed:9784 with SMTP id d2-20020a056402078200b0050047ed9784mr11327106edy.14.1681211788425; Tue, 11 Apr 2023 04:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681211788; cv=none; d=google.com; s=arc-20160816; b=AXgzhNiaMGENXt5CSS5I7psoib2Yrgz8os++Pw/VLugOyos/xqMtBxvBXQMwaURono kxIRPREKVDmZ0JsZ4l8wGpjhz/fjzThKsw172fjhund40x3ENyOwYt0ou6a/OHW1W1FS Oqf3CDoCSCzpYsAOmMqFcDhRxs7a54MJDLjkRx20vtS51V8RLBN5WYdIf1sW2/k7qO3l MbX6RNArYfpK4aTwKAwVU3Mr9yUr2IeRO6h3IV1rm168beaYXRuQWG021vouJgL8DPjK kNCZANru1ROuecGe31OkMXgKXtxBySK6yoKVvWPT6d6nc/HheqnMKsxMQtGQ3lDz2HZG pf9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=YfwM7ExqtcBq3gDzf/UlZgOLnhb0Xezc8o0UptK/rvo=; b=0uDhHvo2eNnnQkqFkuk1NUdt+nB5wuFncyueY9BWuxj2cvew1ARfxLrZTqcgbP6xvX co/kWwMqt8lY7sSv48GxM03G8OPhBw9f9GpNiFlNY+xsxlgiIkKq9LNYFOFpTtHwdAI/ VL9IP4Vpc35JGxoV5RF8lk9jbHmPKwWK0AGaWzDuZbfVLW3TibF3G2LrtL0FEaOlNyFE QVadKceb3SgGgroIW4ZtnwUNr5DrOuiK5cE55nwzHWXjd5P/Cy/503EvWjj9dsQfkW01 Yc+4+R1kfoTD//iyqUXj6t00XWTWIFmx+9PCor3JFqpgT43EZckmj4JM+ekvgMI7bRI3 A3Qw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020aa7c50e000000b00504932c1753si528539edq.497.2023.04.11.04.16.00; Tue, 11 Apr 2023 04:16:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229480AbjDKLO4 (ORCPT + 99 others); Tue, 11 Apr 2023 07:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjDKLOx (ORCPT ); Tue, 11 Apr 2023 07:14:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 936BF1724; Tue, 11 Apr 2023 04:14:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 874F761F95; Tue, 11 Apr 2023 11:14:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA66BC433D2; Tue, 11 Apr 2023 11:13:58 +0000 (UTC) Date: Tue, 11 Apr 2023 12:13:55 +0100 From: Catalin Marinas To: kernel test robot Cc: Mark Rutland , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: drivers/acpi/acpica/tbfind.c:60:9: error: 'strncpy' specified bound 6 equals destination size Message-ID: References: <202304071552.CeeIBr5P-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202304071552.CeeIBr5P-lkp@intel.com> X-Spam-Status: No, score=-4.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 07, 2023 at 03:02:15PM +0800, kernel test robot wrote: > FYI, the error/warning still remains. > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master > head: f2afccfefe7be1f7346564fe619277110d341f9b > commit: 8f9e0a52810dd83406c768972d022c37e7a18f1f ACPI: Don't build ACPICA with '-Os' > date: 2 months ago > config: x86_64-sof-customedconfig-fuzz-defconfig (https://download.01.org/0day-ci/archive/20230407/202304071552.CeeIBr5P-lkp@intel.com/config) > compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 > reproduce (this is a W=1 build): > # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8f9e0a52810dd83406c768972d022c37e7a18f1f > git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > git fetch --no-tags linus master > git checkout 8f9e0a52810dd83406c768972d022c37e7a18f1f > # save the config file > mkdir build_dir && cp config build_dir/.config > make W=1 O=build_dir ARCH=x86_64 olddefconfig > make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Link: https://lore.kernel.org/oe-kbuild-all/202304071552.CeeIBr5P-lkp@intel.com/ > > All errors (new ones prefixed by >>): > > drivers/acpi/acpica/tbfind.c: In function 'acpi_tb_find_table': > >> drivers/acpi/acpica/tbfind.c:60:9: error: 'strncpy' specified bound 6 equals destination size [-Werror=stringop-truncation] > 60 | strncpy(header.oem_id, oem_id, ACPI_OEM_ID_SIZE); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > drivers/acpi/acpica/tbfind.c:61:9: error: 'strncpy' specified bound 8 equals destination size [-Werror=stringop-truncation] > 61 | strncpy(header.oem_table_id, oem_table_id, ACPI_OEM_TABLE_ID_SIZE); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors I think the kernel test robot should filter out any reports related to this commit. The warning has nothing to do with the -O2 vs -Os change. It's simply that the compiler now warns if strncpy() has the destination size equal to the bound parameter (for some reason it doesn't do this with -Os). I mentioned it on a different report here: https://lore.kernel.org/all/Y%2FdM77YdzDKRDdj1@arm.com/ A potential solution to silence the compiler is to go through the ACPI code and change those strncpy() instances to memcpy(). I don't think those strings are even null-terminated in the APCI spec, so using strncpy() doesn't make sense. -- Catalin