mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: david.laight.linux@gmail.com, Kees Cook <kees@kernel.org>,
	linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-scsi@vger.kernel.org, MPT-FusionLinux.pdl@broadcom.com
Cc: oe-kbuild-all@lists.linux.dev, Arnd Bergmann <arnd@kernel.org>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Ranjan Kumar <ranjan.kumar@broadcom.com>,
	Sathya Prakash <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Suganath Prabu Subramani <suganath-prabu.subramani@broadcom.com>,
	David Laight <david.laight.linux@gmail.com>
Subject: Re: [PATCH next] drivers/scsi/mpt3sas: Replace strcpy() + strcat() with snprintf()
Date: Mon, 8 Jun 2026 21:48:44 +0200	[thread overview]
Message-ID: <202606082107.T3scOqQb-lkp@intel.com> (raw)
In-Reply-To: <20260608095523.2606-35-david.laight.linux@gmail.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20260605]

url:    https://github.com/intel-lab-lkp/linux/commits/david-laight-linux-gmail-com/drivers-scsi-mpt3sas-Replace-strcpy-strcat-with-snprintf/20260608-182042
base:   next-20260605
patch link:    https://lore.kernel.org/r/20260608095523.2606-35-david.laight.linux%40gmail.com
patch subject: [PATCH next] drivers/scsi/mpt3sas: Replace strcpy() + strcat() with snprintf()
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260608/202606082107.T3scOqQb-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260608/202606082107.T3scOqQb-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606082107.T3scOqQb-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/scsi/mpt3sas/mpt3sas_ctl.c: In function '_ctl_getiocinfo':
>> drivers/scsi/mpt3sas/mpt3sas_ctl.c:1262:73: warning: '%s' directive output may be truncated writing up to 12 bytes into a region of size between 8 and 31 [-Wformat-truncation=]
    1262 |         snprintf(karg.driver_version, sizeof (karg.driver_version), "%s-%s",
         |                                                                         ^~
   drivers/scsi/mpt3sas/mpt3sas_ctl.c:1262:9: note: 'snprintf' output between 2 and 37 bytes into a destination of size 32
    1262 |         snprintf(karg.driver_version, sizeof (karg.driver_version), "%s-%s",
         |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1263 |                  ioc->driver_name, ver);
         |                  ~~~~~~~~~~~~~~~~~~~~~~


vim +1262 drivers/scsi/mpt3sas/mpt3sas_ctl.c

  1218	
  1219	/**
  1220	 * _ctl_getiocinfo - main handler for MPT3IOCINFO opcode
  1221	 * @ioc: per adapter object
  1222	 * @arg: user space buffer containing ioctl content
  1223	 */
  1224	static long
  1225	_ctl_getiocinfo(struct MPT3SAS_ADAPTER *ioc, void __user *arg)
  1226	{
  1227		struct mpt3_ioctl_iocinfo karg;
  1228		const char *ver = "";
  1229	
  1230		dctlprintk(ioc, ioc_info(ioc, "%s: enter\n",
  1231					 __func__));
  1232	
  1233		memset(&karg, 0 , sizeof(karg));
  1234		if (ioc->pfacts)
  1235			karg.port_number = ioc->pfacts[0].PortNumber;
  1236		karg.hw_rev = ioc->pdev->revision;
  1237		karg.pci_id = ioc->pdev->device;
  1238		karg.subsystem_device = ioc->pdev->subsystem_device;
  1239		karg.subsystem_vendor = ioc->pdev->subsystem_vendor;
  1240		karg.pci_information.u.bits.bus = ioc->pdev->bus->number;
  1241		karg.pci_information.u.bits.device = PCI_SLOT(ioc->pdev->devfn);
  1242		karg.pci_information.u.bits.function = PCI_FUNC(ioc->pdev->devfn);
  1243		karg.pci_information.segment_id = pci_domain_nr(ioc->pdev->bus);
  1244		karg.firmware_version = ioc->facts.FWVersion.Word;
  1245		switch  (ioc->hba_mpi_version_belonged) {
  1246		case MPI2_VERSION:
  1247			if (ioc->is_warpdrive)
  1248				karg.adapter_type = MPT2_IOCTL_INTERFACE_SAS2_SSS6200;
  1249			else
  1250				karg.adapter_type = MPT2_IOCTL_INTERFACE_SAS2;
  1251			ver = MPT2SAS_DRIVER_VERSION;
  1252			break;
  1253		case MPI25_VERSION:
  1254		case MPI26_VERSION:
  1255			if (ioc->is_gen35_ioc)
  1256				karg.adapter_type = MPT3_IOCTL_INTERFACE_SAS35;
  1257			else
  1258				karg.adapter_type = MPT3_IOCTL_INTERFACE_SAS3;
  1259			ver = MPT3SAS_DRIVER_VERSION;
  1260			break;
  1261		}
> 1262		snprintf(karg.driver_version, sizeof (karg.driver_version), "%s-%s",
  1263			 ioc->driver_name, ver);
  1264		karg.bios_version = le32_to_cpu(ioc->bios_pg3.BiosVersion);
  1265	
  1266		karg.driver_capability |= MPT3_IOCTL_IOCINFO_DRIVER_CAP_MCTP_PASSTHRU;
  1267	
  1268		if (copy_to_user(arg, &karg, sizeof(karg))) {
  1269			pr_err("failure at %s:%d/%s()!\n",
  1270			    __FILE__, __LINE__, __func__);
  1271			return -EFAULT;
  1272		}
  1273		return 0;
  1274	}
  1275	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      reply	other threads:[~2026-06-08 19:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  9:55 david.laight.linux
2026-06-08 19:48 ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202606082107.T3scOqQb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=arnd@kernel.org \
    --cc=david.laight.linux@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=ranjan.kumar@broadcom.com \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®