Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2345913rdb; Sun, 3 Dec 2023 12:55:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzmAmeBQAKEBs4dVd0+UTO6JCB0JScdF8eKQZEdMW8FaN5ABkh6n8Zw6RNsMfv59CouN57 X-Received: by 2002:a05:6e02:1b0f:b0:357:4a63:2ad2 with SMTP id i15-20020a056e021b0f00b003574a632ad2mr4662776ilv.21.1701636921910; Sun, 03 Dec 2023 12:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701636921; cv=none; d=google.com; s=arc-20160816; b=PSMTNMpUDjBVhgFtz7Ku7ayrbVmwXQcTEy/g3MU6yKgRjWPLqwSu4k+iak2VI9Lw5i wdg7W9LxBjbc7qqLRZ2KSXTtSjR3uGKyq/OJK7KAjsobFxXcwKKGYVOohR0nyisyr4gU ZRMOMeq8PVgdhSBdixHIR9S0gGj1HZe7K4g53RYkjUDytLSd8S3D+/TzuU+mEJxvP5pF LEoRYQeTl77yv/3jQK9sGsOODcKXC/F50f9AQWlyqAprh0F4C8njl0UTWpO8AxjyYmL0 KVbLyejveT2JZPOWL5i3bZt8VvOG2/HeVBHtR+fWjg1pHpX1S7Tntfo0Z26boYQ/5bPa 2tTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=mkoL5GRW1yQRxowg4OvJz3ED7Ey6jz21dthCJqqVr+U=; fh=VIdWoC74Vw2diFU193vQlqSxo2p0rrxwkmo4E+lNpZE=; b=wv45pAxgLP0M7XEjFzqxBGtrMXW3ont5uXmB4XXS0m74IpauUwPqttlu8JOaOfIOiX 1vfhPvovbs3sYC5C2kQTILgPYnr/g8amiXPYn2n4mH8z7qKQCof0Md8pqnsVeoPp1s/A 3O+AjZwyDWUpn7poGIRjIxZRjEXbbwUoipMfEd33qJS/YbM1pl6TH4YWN0a6XiCRdEpN bEyKAbA3MECLK2g+69yq01QshoePPGCAAJxMHl5JLt4R3b4svW8ifSonnd2qm7bnlBOk 78jjGgZjJTy2Q6y8iPPE9TitdTminEnXmqscs5u11yfyPYZiMVgrA8CXokhtDHSd8PRh LQbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=dLvCS2kc; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Z3FUh2jo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id b11-20020a170903228b00b001cfb4a3adadsi6751345plh.344.2023.12.03.12.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 12:55:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=dLvCS2kc; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Z3FUh2jo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id C9431807E44A; Sun, 3 Dec 2023 12:55:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230004AbjLCUvL (ORCPT + 99 others); Sun, 3 Dec 2023 15:51:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbjLCUvK (ORCPT ); Sun, 3 Dec 2023 15:51:10 -0500 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E2A6CF; Sun, 3 Dec 2023 12:51:16 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1FE0E32004E7; Sun, 3 Dec 2023 15:51:13 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Sun, 03 Dec 2023 15:51:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701636672; x=1701723072; bh=mkoL5GRW1yQRxowg4OvJz3ED7Ey6jz21dth CJqqVr+U=; b=dLvCS2kcTUwS9N4Xm5V+Ixe/ePgUeMixtxKJf6bEK8zUMcZGQHk ihibKZJnuFVA0v76C7DNwXB8RbrZdA2z8QJUhbFwKIa839NgpObO4CnVS22/n4UO QE9fk/dvYOBy2HUTEqb8BMa5/WcJl/dD2QNkL7V7nHsxjotSDl+owVhCjjLJtPjr ovNMAjv0sLXUcIfL9buo0+YcB8gV84cVcMgQEwaK7ZZ9oUXeSxOwHWH+oia7ib6u xX2KbQfx9FR7mRrx8klT4bvZ7DFS+yPlFNEglfBCAB+FXawMFrHMYpNB7U8Z1qtj vmFR7fU4VioOlLM5lJc9KldGa5nn1kXNDXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701636672; x=1701723072; bh=mkoL5GRW1yQRxowg4OvJz3ED7Ey6jz21dth CJqqVr+U=; b=Z3FUh2joJ1dbaU9RDz9StRNo6WbzpMM2RNCmYusIJP4eVk9yP/z CasVYXX8XXAbdfgyx2Q08w1X13OMg6hxfXCSUt+d1u54y+s4EPvZQKqtwW6syjIN JZ1NkiwsXcHPTAn215EPuc9x86iITXaPjkkzYBBf1oP91yTxSuRhveJBJv1kz5AR OdrlHJQ8XlhX6F+rTT9v0/mtpBygAbBPQXlrbIDLwOv4/h6Rb978hQlXt8nG29w1 WZF3M9nPft2prjyQtr3jIDZpyFckO4VFNJ/jSvpx+KMNcqyq9L9x5Rt0XPqFSCmK qVlgXkOPxNwtDJuVle2iUK3pY0aaisxopsw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudejgedgudegvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedf tehrnhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrf grthhtvghrnhepgeefjeehvdelvdffieejieejiedvvdfhleeivdelveehjeelteegudek tdfgjeevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 58C5DB60089; Sun, 3 Dec 2023 15:51:12 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1178-geeaf0069a7-fm-20231114.001-geeaf0069 MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20231127204206.3593559-1-zack@kde.org> Date: Sun, 03 Dec 2023 21:50:51 +0100 From: "Arnd Bergmann" To: "Dmitry Torokhov" , "Zack Rusin" Cc: linux-kernel@vger.kernel.org, "VMware Graphics Reviewers" , "Robert Jarzmik" , "Raul Rangel" , linux-input@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] input/vmmouse: Fix device name copies Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 03 Dec 2023 12:55:19 -0800 (PST) On Sun, Dec 3, 2023, at 19:41, Dmitry Torokhov wrote: > On Mon, Nov 27, 2023 at 03:42:06PM -0500, Zack Rusin wrote: >> From: Zack Rusin >>=20 >> Make sure vmmouse_data::phys can hold serio::phys (which is 32 bytes) >> plus an extra string, extend it to 64. >>=20 >> Fixes gcc13 warnings: >> drivers/input/mouse/vmmouse.c: In function =E2=80=98vmmouse_init=E2=80= =99: >> drivers/input/mouse/vmmouse.c:455:53: warning: =E2=80=98/input1=E2=80= =99 directive output may be truncated writing 7 bytes into a region of s= ize between 1 and 32 [-Wformat-truncation=3D] >> 455 | snprintf(priv->phys, sizeof(priv->phys), "%s/input1", >> | ^~~~~~~ >> drivers/input/mouse/vmmouse.c:455:9: note: =E2=80=98snprintf=E2=80=99= output between 8 and 39 bytes into a destination of size 32 >> 455 | snprintf(priv->phys, sizeof(priv->phys), "%s/input1", >> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> 456 | psmouse->ps2dev.serio->phys); >> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > This simply wastes 32 bytes. It is perfectly fine to truncate phys > (which does not happen in real life). > > -Wformat-truncation is disabled in normal builds, folks should stop > using it with W=3D1 as well. It does find real bugs, and we are fairly close to being able to enable it by default once the remaining warnings are all fixed. It also doesn't waste any memory in this specific case since vmmouse_data is currently at 168 bytes, which gets rounded up to either 192 or 256 bytes anyway. I'd suggest using the minimum size that is large enough though, in this case 39 bytes for the string I guess. Arnd