Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1923686lql; Wed, 13 Mar 2024 11:59:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpmLXV0XBSNF8aZEJciuW0YBC1ypYP4LjnuQODCKlX3HGnVNc9nZcNtUvhFZ1hF8htcOHhX7ltnQ3wIQQ+XJHSP/PXrMz8rZ2xzVwOkg== X-Google-Smtp-Source: AGHT+IHFAj2TuTNMuxjRx3cvnKRaCaQqbUBSVz8/u7VOJIpcW1RNJyNzNw+RmSxmioPf6mBqcPEW X-Received: by 2002:a2e:87d2:0:b0:2d4:6852:f61f with SMTP id v18-20020a2e87d2000000b002d46852f61fmr2511652ljj.24.1710356390117; Wed, 13 Mar 2024 11:59:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710356390; cv=pass; d=google.com; s=arc-20160816; b=SDhFbYrPUFT7/GdbpJVNjLfJxXnJNf4+njCK9Rk7nE8+/Eezn/60R7xuNGHm667ge3 8hHaaN0lW+BqR+3KVv7X9T3I2xRkzHcVUCXDpw1N7DTmE0Mg589tbbc+vWyxg9vUE2/+ dJpBpPBrxq12/qoxTfYozYRQoljWVjw3YjBytkhe74jeFwVUMaMQlOavIZOLaK8PfJOx 2QR3TYLy2/WDtLBYAsTP/EqGgEt8b9qdmiPtkiK8lIuin4LPZVVc8JqmQ+v6aApw74HF BNJD0JG/6oOH+BwnnNN43nXUzQt8vHn+ls2HvHW1IICUqz6SxH1brFP3WQ//oSNSntOw kckg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gXZwYoXbJPdWtL2uBl+Xzu/HgUqqQqktfQtiEj7JuE0=; fh=F9noZPt/4D+l1ZQW+6TzCFyyd6Mw5OCABVSgZ/WlMtw=; b=gOtpN/EqTiLD08CLJf81tYdSiQLbXFvIz17lJ6SPoHb7D3Ehcb2O5guwsH2oe3kEoa YQH3wi+Kz132nivtX8R31e0SRtr2DvEE6Nlm0bRNHAhX5m0E2pgomDtp+2rG1t/RsJre cvG1lm+ft6eoprVPKb3CabFXaTstknrys7U2PSBXOUHs+ApFBTytvGXvry7Y8Fpr+AaM sOt8TaTj91flS1RqVMqwgLEqOlzbldCsA3rYWAcCLCmHCdps9gHDsnuhZUD3+yST83LD Cmj4yXI0INhJGtyWUexnORuZZXw/Y2jlV518jBOp9zdh1GaD6OCLpVwFCwNwf2xEYyU5 +Nkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SRwLPK7X; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-102322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ev16-20020a056402541000b005689396f35asi267382edb.686.2024.03.13.11.59.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 11:59:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SRwLPK7X; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-102322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0AA2B1F292D9 for ; Wed, 13 Mar 2024 18:58:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63E541448FF; Wed, 13 Mar 2024 17:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SRwLPK7X" Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (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 C1EF75917C for ; Wed, 13 Mar 2024 17:56:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710352619; cv=none; b=Abjmero0wM0IxigtL0IcoNbNDUQR2Cc72SE5L/eVq6HW3WBbQdkgnJqIqg9hLaUstAiQTkG8Kshtz4ujSQiDTCexwsxvpeSCipUk7y5Df0mHVneqe5nudA2+j9HR35F1fBub29yh5aMDnzoDcm6brUAFUN5ZcvN02nGe1HLssGc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710352619; c=relaxed/simple; bh=Il1ZTrrhxS2JwxtKteGg8c15At7P4qQJlxAx1oYisIw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YMHwM8431h6xWn7VfvPVAJHUYLvn6rqJH3FocfytORb6W6cvCISryOxS1dscom4y1BB5LiXLZGmT9JdO44pxTzAyqWeuBEUU/Lbj/dyOFFHGY33NBgq2gxXkgOMMxhQPIW3pSSjBBgk11jM7/NnqocrYW6SrI7CDtSY0HcLAKvo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=SRwLPK7X; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-566e869f631so138721a12.0 for ; Wed, 13 Mar 2024 10:56:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710352616; x=1710957416; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gXZwYoXbJPdWtL2uBl+Xzu/HgUqqQqktfQtiEj7JuE0=; b=SRwLPK7XQNLhM/5uVb1b6QxlXJGvcB+E2m1BoD0zyrUUKANrDCwrZmq79y8mPPLKTL nLMlPoD+6ffugAEXn0V2NtSzii7tIjuAcTDpqpgMShTsptbJmmOhWOE6p+aU8yjrquNP DCapgvdi5XjLp/AHhVl42xqjLqftAQwKDBfGcymdp461vdTBoN/4xcdwprQkrkCDVvD5 s2I8Q3zaGPHHTF0dSV1QU1QUr7XF5volk4RmvWb+MDEaqJny2WAbKEJjSd3zjx/2HL1H bD0jpnujGRgrORlboXLms+pbFcOfRXCaVmnmN219rT4zNBLX2VrTY51+A9hsPE3o+bEC k3gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710352616; x=1710957416; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gXZwYoXbJPdWtL2uBl+Xzu/HgUqqQqktfQtiEj7JuE0=; b=d0GXK2uNUD5135a1h9X3SxcTuMk+T4qlrglpxuxqCXrU7VOuD3XoPwY/u7BkGOyCcO 1PK8c4QGTOCse7oueQVwTOxAfZHQu3EUgaHGil1gOiZYe21bL2GP+7TaGYGP6cgux8Ri L8Si/D4TUcA+22EfHt6kKy1efLRNx7oPmTHClFxeQiLcP0Fb1W58ix25Rc5xqQ1rH7wo BrgGdaER4eUeSZ9dlJY8KqeLeXnfw/SSXfAHoJgwtJ9IFPx2nxpYlbfWpqjPf7e3sV4p T4l6oXPcjVuBPKiNJxftybTMmDnwMK7LYfxsvqVvx2L4U6XnhXJB/jx/GSdpfOhOB8UT nJ7w== X-Forwarded-Encrypted: i=1; AJvYcCXDKwjp/qCDDXQEO81FaInKuXkwxefoSmFaXFKfPlMjUobMZX5xS03378pPJiOsE0ME9Jjf67DkwV6LUL0rfAPcG8NBlQK6Czmwaz2k X-Gm-Message-State: AOJu0Yx79hh8Z2eVKxAxVkQEWHrN3mjgzrrpzCluj0B0y3TqPN9jHmq2 uPESFkfG/oK+tCJh6cIRX2tOYNafeLPwyBkKB/DMzlcwQ3kkR8/TK9bZYYsZNnM= X-Received: by 2002:a17:907:8a85:b0:a46:5e38:29d7 with SMTP id sf5-20020a1709078a8500b00a465e3829d7mr1637002ejc.10.1710352615843; Wed, 13 Mar 2024 10:56:55 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ku2-20020a170907788200b00a44936527b5sm5062753ejc.99.2024.03.13.10.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 10:56:55 -0700 (PDT) Date: Wed, 13 Mar 2024 20:56:51 +0300 From: Dan Carpenter To: Arnd Bergmann Cc: Florian Fainelli , Greg Kroah-Hartman , Arnd Bergmann , Broadcom internal kernel review list , linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: vc04_services: changen strncpy() to strscpy_pad() Message-ID: <2b7d9a97-e180-4bcd-bc75-bde09a6d2157@moroto.mountain> References: <20240313163712.224585-1-arnd@kernel.org> 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-Disposition: inline In-Reply-To: <20240313163712.224585-1-arnd@kernel.org> On Wed, Mar 13, 2024 at 05:36:56PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > gcc-14 warns about this strncpy() that results in a non-terminated > string for an overflow: > > In file included from include/linux/string.h:369, > from drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c:20: > In function 'strncpy', > inlined from 'create_component' at drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c:940:2: > include/linux/fortify-string.h:108:33: error: '__builtin_strncpy' specified bound 128 equals destination size [-Werror=stringop-truncation] > > Change it to strscpy_pad(), which produces a properly terminated and > zero-padded string. > > Signed-off-by: Arnd Bergmann > --- Thanks, Arnd! Reviewed-by: Dan Carpenter (Greg is on vacation so I'm playing Greg for two weeks). In real life, 128 is way larger than necessary so it's not an issue, which is presumably why you left off the Fixes tag. Anyway, it's always good to replace another strncpy(). I see another bug here where m.u.component_create.pid is never initialized. I'll send a "m.u.component_create.pid = 0;" fix for that based on top of your patch. regards, dan carpenter