From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6361418859B for ; Sun, 7 Jun 2026 08:40:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780821634; cv=none; b=oylxw8ZX/B2H0XZeB1EOyYtrJ8nAQKG9yLpk03wry3jeuQsKsXAY11gTkJ1D4dP3x5OC7UNoniV+BJsRAlvX0TydLlVZyVOtFbqqsaKft+D3GHrvTyK6gJRchlp2XHwFEpkMptY99LXfvmd7rbFqS2UkpmmVoDRyKq4rjw1Vnxw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780821634; c=relaxed/simple; bh=z4rfpECDUd4+fp5V8mPcIWgEOMMN5fJNP5S4vnw9JZQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iFIz8RIUIwRj9jcrsGAe/sGPyjHRI8+fOCfYsDSC+gePTFrgAYHwu5pg2YtH72+j3Hfz6zM7dxfyftr66+mpTyCsuavuJ5azZ+p8Ld9NAE72fcfWTxtUhs5IIWh5cpS3fStkUDGWpEQ+3IcGtEn4QqcJ0KdlLQBWPxCf0YNc3JA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pmejJxmj; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pmejJxmj" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-45fd461e4a5so2293035f8f.0 for ; Sun, 07 Jun 2026 01:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780821632; x=1781426432; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=vw1xVuhJOQHbfyU6Yw8EFKK1j/gn1/vNa/UVGcPSkm0=; b=pmejJxmjJQVSWjPE32PPEmG9rBGizJfyA7rkEx+krkJnmAEfuCfGKZR2+Iwrx/K7z8 fs7XNrZL+QVL0rGQ70IpR/rH5/dFFth3mTf5C7J2kPGxsYc8AIJ+0PX+USVJIVcF9XYz LhACWI+SQIOSgqndAMsy6RJSs8rc7MfOnONJt33b9eubWRUMa6er40QOpq5Q9URtzRjD NZYjfxWMoIcI9utncep3/EC55vTjYfSRB/D5rfolOw0W7WhyjydH2AqWy5lcU2sIaQ3s afpVThSoLAplzbZQRSDQmVSzYlXkCPHSNVSZZuGhCydGGiAalUO/Xckvdlc+uqqVJOxt Rdvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780821632; x=1781426432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vw1xVuhJOQHbfyU6Yw8EFKK1j/gn1/vNa/UVGcPSkm0=; b=NK08nqhi2NYr7I5cuBu4ltRow7i+CzfreyoXfauCwHsJ60JzNDkolDHrV5EUvrzsxb qqIKkfQDMVrsg3NBV8yLSAzk6oX0AnQMTHz4XRH69sDFmo4WRWSe0Vpq7ILBAhkagfHk mH+E8UWNYXLa7mRJLmNSjOwQHGdUl2fQVbVU+0zYc5mMbyBHHlwjjLs513pl5dHbsovx GX26huOu+eIP9TAlxpPiVIFJ0Ji5jtuAEWox1TNCy0bhmxGC75O2uQxkTynTjO/DmSQR WIeO7jwdboN1XC2MG7XSS3gpVhJT+Bt66v7oQhszVt0bnY2TVdejiE7Js0Fg9a/ygBZe RvTw== X-Forwarded-Encrypted: i=1; AFNElJ+4kHjSzBWVDrzbgvfoHGYgxopr4gu8LXnvbB5ZClhxSnA3lPodiiiKzr6Zwfl/jVH2wdW3gCaj9PyWBQ4=@vger.kernel.org X-Gm-Message-State: AOJu0YzbYMD++mdIo+hOXyanggn1wEweSHNc1zWYuuBPoWPFvR0WUUVf ocFqa6sywAbS1MnNYNS1SE3jux2UZqpDJDWsA0N2LSZHvQ+xCNBtxWtn X-Gm-Gg: Acq92OGmiTAzn+GaPAtIiMSgom2/bMCgYJoI25Fo2ckV8xlrWwrEYTPxcELEajOTjFk 34g4JTZEqmZ8ct+dhWCaKc3W5rxf56pC1Rhla5MlyHPv4MCpDVurd4BLlq2EduZTnaIf6GDhP3T kFcq132sneUHQtUMm0fmik5GAKTMdsuEa6wiZKqQ9wLwE0E+Y4OLcq1iyZCx+gMYxega5T6wrmi y2c7pMWKspB8imHL4ritDrHe9oDNENkkyWaueppEZ25SsXEM7WSxa3C5ZCqFNkKDS/8Vj4oHuTW CMl+ojDZoDIWNRxONiIG08doZR+aV49AodlNPOVrk5IIlQFzV7oMLxH+L5NQ0YOmW8JtMTsOOIl MddIyatlPCBRC8jmE75AYuqbo20j48iM91QHGrX3RYqaSVykEGXHLD995tQWi5CZeaLEq5+T/gF MtY8ocdOlnl7eI0IZX4BVd+2xxn5r53jCLqM2UiH8qyVN4U2f7CYZQVU5X85IvR+dUBp0JOmCCk 56RB5qWNA== X-Received: by 2002:adf:f911:0:b0:439:c18f:5aaf with SMTP id ffacd0b85a97d-460307625cbmr11917197f8f.34.1780821631657; Sun, 07 Jun 2026 01:40:31 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4601f2eadefsm42644235f8f.11.2026.06.07.01.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2026 01:40:31 -0700 (PDT) Date: Sun, 7 Jun 2026 09:40:29 +0100 From: David Laight To: Vincent Mailhol Cc: Kees Cook , linux-hardening@vger.kernel.org, Arnd Bergmann , linux-can@vger.kernel.org, linux-kernel@vger.kernel.org, Marc Kleine-Budde Subject: Re: [PATCH net-next] drivers/net/can/usb/kvaser_usb: User strscpy() to copy device name Message-ID: <20260607094029.6ffd4eb0@pumpkin> In-Reply-To: References: <20260606202633.5018-15-david.laight.linux@gmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 6 Jun 2026 23:16:47 +0200 Vincent Mailhol wrote: > Subject [PATCH net-next] drivers/net/can/usb/kvaser_usb: User strscpy() to copy device name > ^^^^ > Use? I'd forgotten I needed to fix that typo before sending the emails. git makes it hard to change the commit text itself. > > On 06/06/2026 at 22:26, david.laight.linux@gmail.com wrote: > > From: David Laight > > > > Signed-off-by: David Laight > > --- > > This is one of a group of patches that remove potentially unbounded > > strcpy() calls. > > > > They are mostly replaced by strscpy() or, when strlen() has just been > > called, with memcpy() (usually including the '\0'). > > > > Calls with copy string literals into arrays are left unchanged. > > They are safe and easily detected as such. > > > > The changes were made by getting the compiler to detect the calls and > > then fixing the code by hand. > > > > Note that all the changes are only compile tested. > > > > Some Makefiles were changed to allow files to contain strcpy(). > > As well as 'difficult to fix' files, this included 'show' functions > > as they really need to use sysfs_emit() or seq_printf(). > > > > All the patches are being sent individually to avoid very long cc lists. > > Apologies for the terse commit messages and likely unexpected tags. > > (There are about 100 patches in total.) > > Indeed, this is terse. The commit body is empty (all your comments are > below the --- cutter) and the subject line contains a typo. > > I don't see why the fact that you are sending many fixes clears you > from writing a proper commit message. And I would expect at least a > small effort to customize the message: only explain the Makefile stuff > for the patches which are touching a Makefile. Try it! I changed about 150 files to get allmodconfig to build. I only send patches for 45 of them (otherwise I hit a 500 email/day limit). The next 45 are 'pending' and some of the uncommited changes are less trivial. Spend 10 minutes sorting out each commit message and it is another 16 hours. A few (like this one) are very terse - then I realised I can send slightly longer commit messages by typing a multi-line argument to -m. -- David > > > drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c > > index e09d663e362f..2cd58e825e0e 100644 > > --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c > > +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c > > @@ -746,7 +746,7 @@ static int kvaser_usb_hydra_map_channel(struct kvaser_usb *dev, u16 transid, > > if (!cmd) > > return -ENOMEM; > > > > - strcpy(cmd->map_ch_req.name, name); > > + strscpy(cmd->map_ch_req.name, name); > > cmd->header.cmd_no = CMD_MAP_CHANNEL_REQ; > > kvaser_usb_hydra_set_cmd_dest_he > > (cmd, KVASER_USB_HYDRA_HE_ADDRESS_ROUTER); > > > Yours sincerely, > Vincent Mailhol >