From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF185C54E66 for ; Wed, 13 Mar 2024 17:57:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JwNOlARGLofvOYv1Zl1Mx5/N7Cm+3nDTQLjLvISh0fg=; b=PhlLQD1EGdsYo+ eUwlUIo1G83qksLu9AigXOe1CA3Hlz0LldrWxTo8H1trsQMEQsgOwyEbKX5GADEZaSEoes92Wz752 hYt20EeeKRiuPQCjlLo91qHfDBtaxfCplDCTnY7q+gVxsfJNoozxUmZfUNEUHO0D8hLT9zt1bMObs GeU89dtYAaVDeYNVCMSJYDFqVpapbyZZJs9NabSZSWJbyRHeJG7UP8b+RH3/gcpOHzn8XZqzt8cSB mbQViY5NJP0QqW2Zq56ukixRhz4Ne8yUhRMVG4sRmyD+B6HiRQSrPwEwsnun39nl/jqqyWAdKq+0M +7Hldx9pH5Zn/sr4fNrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkSqd-0000000BAS8-3WCd; Wed, 13 Mar 2024 17:57:04 +0000 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rkSqY-0000000BANU-0VK4 for linux-arm-kernel@lists.infradead.org; Wed, 13 Mar 2024 17:57:02 +0000 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-563cb3ba9daso112671a12.3 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=lists.infradead.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=Y+IO2WRCIBBpJJupyOP2DopS0jE0nwT8IegphBh9Pgi/Za/HvTKNOmHO+Q96XUWkjk sQHZUrTV1Uo1CR8wukkaPA1NKiCeLjj7JDv9FVwe7XDW6OHvMeOJ5RbXa8GuxBOaLMus TxlzbOO/yI5FxDJ/B7rmuYac2rdeHFk1zyX94B7qarPsfRgPViND9yoD/u70z3uuAPFp 9Fh2ZMi4rkOJS2ZemGnxBBZ4JU0XUx8bWdeubvlzKSD3QoUM7o8DgZPRpM4zVSjDTCZV b4kL0C70GnVNylw72V/iIFQdZTItuunw54ppPcJLTFBFUf1UbGqUlNNs8D8Ulqtuu6zO 2h5Q== 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=AMqWpFRzF5zF+Tc9HW5uQ8KkyOsCTo4qTMBwr9l4LawzU5AwHVDCORmX2t5LW4RmqC Xzrn449iDXfkhjbDQZalNQAe50nyjM0p+p7pn4eqfk1PShp27otc3SaaL+RaG9O4Uzd8 MyuiWyXCHx2ltLUKzOi7C9TxlP8np2wc1E4ZD+dNKKY9STdeiHEmXIqVYtZj8QjOnatX hP/mwqHCkuqE8P+buQWHK16ye2OHTQPHgrgXxvSI+/sGXRc0qjN+ZI4ISoI1a9NwW2Ai TSMmtLa/LdsPjosQCJUiwi8QW0Jb0jdDCcZuVE9gbN6pcljIfZNNrvlPFJdLS2UV6edt rulg== X-Forwarded-Encrypted: i=1; AJvYcCVM7MbIfhylpLUnL5eDElqHG/pEN9JYeyarXR2pQ+0T3mQQPksGR0mGwwXQZFs0//6ciW2XlmJJOylOKJ1Rt26laEOXhsGI2CKu1xY9FBAldL0itcA= X-Gm-Message-State: AOJu0YyPl2qNuhk2E9S7tRbNnCkDCNOeX8/G7wCvDB8Uun/n0udaW3An V8OOacYDvdhs7Nqb7ZacxAEcKyToYbEQXagpb+cO7EtWgf7BwzXawVhbv6HQeIo= X-Google-Smtp-Source: AGHT+IFMICn1OAbDlmUEX0+eM+0X564WncVJ4CS+mHVBBJ1+2xobFpP0SJzPOjoFCL42xKef/8oJ/g== 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240313163712.224585-1-arnd@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240313_105659_578695_BCEB92FB X-CRM114-Status: GOOD ( 15.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel