From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f65.google.com (mail-yx1-f65.google.com [74.125.224.65]) (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 DC94336CDF4 for ; Tue, 3 Feb 2026 18:17:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770142659; cv=none; b=tEO9gRppzTumpimq3hcwDcGTIAN7myj9cVKPbcioQDvr46vifjhhQ/6LXpSBh4CxV6MxX33RfmDkz9Ysw5+mk3JhAG01Kdwk7tDrOuDe0qAKklGJrPy75IlLLduXGfYPHWJNttgCVGbhLGjHN5eXD4RnqlEJparZbKUH2TCMmhQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770142659; c=relaxed/simple; bh=cPxuwbokChawhBR2aJF0YsS2ia7mjo7SWH5dY97bhbc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UShOt5N7ThgMMEDsY6F6mrd3ItFnwOjmpxcTZ/rIYJXtb/h0Gt8CJ3Lr02jKeKhO7azEBZh1BkAlBCR42apq+9WzLMDCo9J8JyIS882XxqLEwFesx09SA6XKxcyDxNfkOy+qlKs9tEL6Nz+WPN9siTdua4tSZfAXQclcgSdA0fQ= 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=VQoCM9nl; arc=none smtp.client-ip=74.125.224.65 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="VQoCM9nl" Received: by mail-yx1-f65.google.com with SMTP id 956f58d0204a3-64938fce805so5414156d50.1 for ; Tue, 03 Feb 2026 10:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770142656; x=1770747456; 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=IfQQ/hkIcrRAkW7v/0G9Sw2aYsY9fMOv4jWxru/t/J8=; b=VQoCM9nluV/MckcgwJYwMR3GkZ735jdk4IrWPEyD8ZQF4bAvJQEBp+5fHx8o2BWv+x chYOsmBLwhhmWq7N0IoRLXHbwzimEF0Jmk1zMbtVRdmnzpPZ6C7ZSqBBa2QKh7E8y1Rt FVnAT4SZpiXZFAp8FE83IV0623TVPTpOTmWTiP5Vgz6aOWY1rG722Y2J8wT0q0Wbwamd lqay/AtqAstKpp55o/QkcvbZDBiovmrT751c46AdeTljE2hhkBXbalLx9dMLOyb0rO6Z pa0X+zPzi9kl8JEeB3fvKs403tmM5lSK82+e/VCUi5iDN+96GHXrJ4JPLoiLw4C4w7L/ hEeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770142656; x=1770747456; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IfQQ/hkIcrRAkW7v/0G9Sw2aYsY9fMOv4jWxru/t/J8=; b=cguDv1YpKf+S/Ks9QvuAjLgtcRlZU9GGP0abTA7EJP3Id/JOHoYgu9nlXNFIoFf07t lipqoDNWgsA5YUPI9iEIk/TDjmNPkugeQC2AP2biCRETQvRZ+gkCu8zz5LwGKUV2D31C ce0hhdHdud3Jq7+FFpkb2sdyeGQab792HCtAu/Yb/ortT8FkwJYbCwtYpb4X3+r7ote8 ft412EqkgqT5PknUC+oO+7Igiho6WcckOH4oOMjDYYubzTw4shi4ilR4CHqlrdzpXO0g 1XeV88aqvBg/93LABxxb9sODhUuMCVgM/6mJUa4kd7MjysJk6MkIvvex85XtysuoV1cS 2XlQ== X-Forwarded-Encrypted: i=1; AJvYcCVtIQMeM11XRYxgMxOTh5s/EUQfCODy0MV08Sf+kZyKPgnegEfuSOT2rGYx7VjMV4je97FBzmiGZSyq2jI=@vger.kernel.org X-Gm-Message-State: AOJu0Yz70Lo2sgFSzbLF7g96lN+E0glvftcxFgx5MB1/OgbFp+0S44yS iGY6qvdOwGKNgNPjKe5hjL8X4aZLMsaAvQu3GmBmnOEixqHKZ5HuCXxe X-Gm-Gg: AZuq6aL9t3Jlmu2fJrY3701VCYeN2n1QlK1d2k6DZudxqdtqWRikX2JH0ehTJ3FjoCf zndRjL6ae/ibOceYvkN/mXGJMc/Y+QwzAyRLrYze/5Qr8H1kPAXYLjJFHxI+mFU75VD+qblr2jm PpwAB30FuynF500HtADpMbCwVTBFNSMlCI7C9tgN2HVpFT2NP14zZ/YmQCuvLzVljivBiMn2Rzo 83IZD/jk7ILu/mkzvIef4A+ozIZL4PeUn0uOd2EPNnYTp5nU/MVm71/bIhtD9USsTmOtMYKv+NR OBQZNukxM9rNBASVfoz1BurCF1KHsNBz1/xYK1OwmF8VZbd+OstQLTi7GYQXjNrON9TiRLvRulN KPiuGr29vqtIKnhKLc3UgSAOwye4WRwfPeuHOTN4ZlN0e4iHoSyep1cgzt1IumFeAUI6FKOdCMg otI2x6hMcd6QHD5ty6tZht6WUfIhdfME4V9LTVb5FH0Z5vIO7cYFPmtd+ID894gl9WxcUKCuL5B Crcdhgz3CKa0y210P46 X-Received: by 2002:a53:d249:0:b0:649:c512:1430 with SMTP id 956f58d0204a3-649db3483admr346374d50.26.1770142655428; Tue, 03 Feb 2026 10:17:35 -0800 (PST) Received: from devvm11784.nha0.facebook.com (fwdproxy-nha-036.fbsv.net. [69.63.189.36]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-649dc5aca33sm65624d50.14.2026.02.03.10.17.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Feb 2026 10:17:34 -0800 (PST) Date: Tue, 3 Feb 2026 10:17:27 -0800 From: Bobby Eshleman To: Arnd Bergmann Cc: Bryan Tan , Vishnu Dasa , Stefano Garzarella , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arnd Bergmann , Broadcom internal kernel review list , Simon Horman , HarshaVardhana S A , Bobby Eshleman , "Michael S. Tsirkin" , linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, netdev@vger.kernel.org Subject: Re: [PATCH] vmw_vsock: bypass false-positive Wnonnull warning with gcc-16 Message-ID: References: <20260203163406.2636463-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: <20260203163406.2636463-1-arnd@kernel.org> On Tue, Feb 03, 2026 at 05:34:00PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The gcc-16.0.1 snapshot produces a false-positive warning that turns > into a build failure with CONFIG_WERROR: > > In file included from arch/x86/include/asm/string.h:6, > from net/vmw_vsock/vmci_transport.c:10: > In function 'vmci_transport_packet_init', > inlined from '__vmci_transport_send_control_pkt.constprop' at net/vmw_vsock/vmci_transport.c:198:2: > arch/x86/include/asm/string_32.h:150:25: error: argument 2 null where non-null expected because argument 3 is nonzero [-Werror=nonnull] > 150 | #define memcpy(t, f, n) __builtin_memcpy(t, f, n) > | ^~~~~~~~~~~~~~~~~~~~~~~~~ > net/vmw_vsock/vmci_transport.c:164:17: note: in expansion of macro 'memcpy' > 164 | memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait)); > | ^~~~~~ > arch/x86/include/asm/string_32.h:150:25: note: in a call to built-in function '__builtin_memcpy' > net/vmw_vsock/vmci_transport.c:164:17: note: in expansion of macro 'memcpy' > 164 | memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait)); > | ^~~~~~ > > This seems relatively harmless, and it so far the only instance of this > warning I have found. The __vmci_transport_send_control_pkt function > is called either with wait=NULL or with one of the type values that > pass 'wait' into memcpy() here, but not from the same caller. > > Replacing the memcpy with a struct assignment is otherwise the same > but avoids the warning. > > Signed-off-by: Arnd Bergmann > --- > net/vmw_vsock/vmci_transport.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/vmw_vsock/vmci_transport.c b/net/vmw_vsock/vmci_transport.c > index 00f6bbdb035a..a64522be1bad 100644 > --- a/net/vmw_vsock/vmci_transport.c > +++ b/net/vmw_vsock/vmci_transport.c > @@ -161,7 +161,7 @@ vmci_transport_packet_init(struct vmci_transport_packet *pkt, > > case VMCI_TRANSPORT_PACKET_TYPE_WAITING_READ: > case VMCI_TRANSPORT_PACKET_TYPE_WAITING_WRITE: > - memcpy(&pkt->u.wait, wait, sizeof(pkt->u.wait)); > + pkt->u.wait = *wait; > break; > > case VMCI_TRANSPORT_PACKET_TYPE_REQUEST2: > -- > 2.39.5 > Reviewed-by: Bobby Eshleman