Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp824002iol; Thu, 9 Jun 2022 15:03:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxDJ9uxVBWxjODQtB2PEuK7C5nALFqTCYvOt3fdLxFFSsD1rabOhJS2ZqJnmNAGGVfoEKZk X-Received: by 2002:a05:6a00:996:b0:505:b6d2:abc8 with SMTP id u22-20020a056a00099600b00505b6d2abc8mr109488654pfg.11.1654812232708; Thu, 09 Jun 2022 15:03:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654812232; cv=none; d=google.com; s=arc-20160816; b=dicQhWwEu6cO4u3ILAl0aWefZGsC7/QedGNhliBpRGAMPjsoHOZEtlbjvVWB2BgGzh JxNghaZsLN9X7FWFEdcF/8ZPYXS3rP90+hpBeqCYz6P8UagMjb9xyWgfyl0KnjfLYSYQ v/UsCRr+mCu+HPRgfAonBRF6yBaC9OK42NKtq3ff+vH3FyCfUiTSj1Vaj+cLXAP1IuZR Rs/Vds1DByiaUQ7kTROMMscW+ucxESmhsN3MPL/Me5uoZWD178Sb2phW6rm0rZjd2xsG aMh/vLE8nhPpE4a1zgIFcUbaCDBnNwuyXHKSflTuEaZ93T1rOIxyRKQJrKo+lrYyLY6m 6Jhg== 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:dkim-signature; bh=iZR+IWL1nbvv9uvVUTXlDlRlv72ovlHUM/dFfy+Q5mg=; b=q24LVw2xLtP3V5K+T8wt5npvjnOhdb2dGILfNHAWNFvzK02aE8WscCc89cog1TV+9G 07v+Q8jFVbok5wrRd+nPMJsNFGIgUNnayvRCTUggyHJl0jcIn6VoHHwIdIcmuCr0m6nO uWDP8ExhAevITPPUBz55yrcsX6SUXM4Iq0elOjhw7RzePHA+UIsP3plUOiyGzxm8Gnfb O5k7dKXpKV9FtgEBtRROi38dtztB3xt1QQdZ+831EQ6VYNlpYU6G9Mtah/smuWLAo2yK flDmp1utEIMUMoLd0BUD1QXt7fYV52AIT4hTUgRMUaBUkqZ8dPXeDY5gKYgXa5jPmeH8 wAvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ANhNfraE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j189-20020a6380c6000000b003f62669e1a7si31157564pgd.767.2022.06.09.15.03.38; Thu, 09 Jun 2022 15:03:52 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=ANhNfraE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243685AbiFIVI4 (ORCPT + 99 others); Thu, 9 Jun 2022 17:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343754AbiFIVIy (ORCPT ); Thu, 9 Jun 2022 17:08:54 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA1726E3AE; Thu, 9 Jun 2022 14:08:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654808932; x=1686344932; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=FbGkoYDcKil9L4cjrpUTys3dGh2NgTLalBdxCIb5Goo=; b=ANhNfraEO4HJWKIZ/dPMfBw036TPdqCbaoiKS81vQVzVlZF+KoaLCSJI vdlph4+xB668bbu4QXHBaF13ReJ4oMZh8bU6HP1KyssNsfBucGJAHkJSO tuJjkkPeAj+HmaSAL+29NAqYvrZ8ZQcmLyJVVQxG+nOZMWFU49yRBkQ89 SES9UHHn+v9ak6OwK7ir5L2ESsW/cJNLJjQ1FKKlBWNYdCWwWdnbvFxv9 t+iKnI+uCxRUuUyhktukeHqVObvKAQSBvjPbhaDUMHcM8Goa7wKRz+94D JZzz5rtFGjcJwvREQn+u5rpS7e9eB7/SUXW/PZA8RXsIJw+AlX8qlaHx5 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10373"; a="276191120" X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="276191120" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2022 14:08:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,288,1647327600"; d="scan'208";a="710610570" Received: from lkp-server01.sh.intel.com (HELO 60dabacc1df6) ([10.239.97.150]) by orsmga004.jf.intel.com with ESMTP; 09 Jun 2022 14:08:49 -0700 Received: from kbuild by 60dabacc1df6 with local (Exim 4.95) (envelope-from ) id 1nzPOa-000GOM-V9; Thu, 09 Jun 2022 21:08:48 +0000 Date: Fri, 10 Jun 2022 05:08:46 +0800 From: kernel test robot To: Saud Farooqui , bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: kbuild-all@lists.01.org, Saud Farooqui Subject: Re: [PATCH] rpmsg: strcpy is not safe, use strncpy Message-ID: <202206100428.A3CCM24E-lkp@intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Hi Saud, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on v5.19-rc1] [also build test WARNING on next-20220609] [cannot apply to remoteproc/rpmsg-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/intel-lab-lkp/linux/commits/Saud-Farooqui/rpmsg-strcpy-is-not-safe-use-strncpy/20220609-024555 base: f2906aa863381afb0015a9eb7fefad885d4e5a56 config: sparc64-randconfig-r026-20220609 (https://download.01.org/0day-ci/archive/20220610/202206100428.A3CCM24E-lkp@intel.com/config) compiler: sparc64-linux-gcc (GCC) 11.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/b6e6a64ab89042911604aa4741584a422cdfe8a5 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Saud-Farooqui/rpmsg-strcpy-is-not-safe-use-strncpy/20220609-024555 git checkout b6e6a64ab89042911604aa4741584a422cdfe8a5 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=sparc64 SHELL=/bin/bash drivers/rpmsg/ If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/rpmsg/rpmsg_core.c: In function 'rpmsg_register_device_override': >> drivers/rpmsg/rpmsg_core.c:607:17: warning: 'strncpy' specified bound 32 equals destination size [-Wstringop-truncation] 607 | strncpy(rpdev->id.name, driver_override, sizeof(rpdev->id.name)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/strncpy +607 drivers/rpmsg/rpmsg_core.c 595 596 /* 597 * A helper for registering rpmsg device with driver override and name. 598 * Drivers should not be using it, but instead rpmsg_register_device(). 599 */ 600 int rpmsg_register_device_override(struct rpmsg_device *rpdev, 601 const char *driver_override) 602 { 603 struct device *dev = &rpdev->dev; 604 int ret; 605 606 if (driver_override) > 607 strncpy(rpdev->id.name, driver_override, sizeof(rpdev->id.name)); 608 609 dev_set_name(dev, "%s.%s.%d.%d", dev_name(dev->parent), 610 rpdev->id.name, rpdev->src, rpdev->dst); 611 612 dev->bus = &rpmsg_bus; 613 614 device_initialize(dev); 615 if (driver_override) { 616 ret = driver_set_override(dev, &rpdev->driver_override, 617 driver_override, 618 strlen(driver_override)); 619 if (ret) { 620 dev_err(dev, "device_set_override failed: %d\n", ret); 621 return ret; 622 } 623 } 624 625 ret = device_add(dev); 626 if (ret) { 627 dev_err(dev, "device_add failed: %d\n", ret); 628 kfree(rpdev->driver_override); 629 rpdev->driver_override = NULL; 630 put_device(dev); 631 } 632 633 return ret; 634 } 635 EXPORT_SYMBOL(rpmsg_register_device_override); 636 -- 0-DAY CI Kernel Test Service https://01.org/lkp