From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 085043E9F81 for ; Wed, 4 Feb 2026 11:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770204596; cv=none; b=s5gEftjkuDPxWvUbUTjW+7y8RNPjgNAHgKrYOF1pdCSy8xaFexSr8pcztsE6prWjy8CDjZE5xNZIclL5u2xXjmGTWpn1/POeXNNk74PMofznRmnhmHb4sKhUIGk/guVkWUAgPnjO/sPIR4Earvk4MxAtVygTMbPDKpUJgfbCfxM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770204596; c=relaxed/simple; bh=ShwI4jCjSP8+m7Os2djvrxNO/fA9bUZq/Yv5KhSFlvA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GHOq5xbvuad3f2msTmcJOWJyAX1jiTLh5kVjtX0QXzRw/0fKv8HluW/sPK4hAVqnuqvuAsqgUkeDJYfh1oJQ4N3Y6KlawHVE/PD7ysjYRN5ySdQW+eoHxnt9JN77SDofyzIS9Bmvw2UkNnYNQn/o+Zy8E6WWfFQ+/Ia1eUIm3ic= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=V2YqY09F; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=gf9X3Jv7; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="V2YqY09F"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="gf9X3Jv7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770204595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zqOiwAx1+q0FKyReAOUgZRpz2E1HnCP+W30z4rd0Qx0=; b=V2YqY09FtnfjqepMkYJRHTgJimMpvbyLSe9a3u4+0ksKxEwMeJbvVw2VowxA/KBZhNCb2m oZGQo3LDLKM1Vs7a6qhli2NQM4yYNMuzMnnuk2TCAuij8A2fHIZ7mv2XREwrh9VGSz6QLN Cd+kG9PzVqaIGzXdPJilNLT10SjG0dQ= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-694-ymvl6_YLPcGNIIo3VO28Vw-1; Wed, 04 Feb 2026 06:29:54 -0500 X-MC-Unique: ymvl6_YLPcGNIIo3VO28Vw-1 X-Mimecast-MFC-AGG-ID: ymvl6_YLPcGNIIo3VO28Vw_1770204593 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-430f5dcd4cdso5669251f8f.2 for ; Wed, 04 Feb 2026 03:29:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1770204593; x=1770809393; 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=zqOiwAx1+q0FKyReAOUgZRpz2E1HnCP+W30z4rd0Qx0=; b=gf9X3Jv7fhiuOUmepNhbiaGAZgkeQ+v/SlFxuLNajgjPXQGPl0RhUF4Pcnbl23E7Ft JC2CsEWLlkuBUUsHhE1Todr8N5lfLrTzQjPzRTaunn5pIq67nt9pR3K9Pnu21blsuxjW Mp5na/pMww1CsVP0YO7h4Jz7rTs+E1prBQkFoi/85hWr51gS8UdVyqwxy9xEUEb7m4AG rdX56sYMN3c7MVlcOfZ9mIpMCURYXx+vuQAIeGpbVnZutJrPjRMlINDFTt+wvBnuNBqI XAj7hEQms0bL6/pq3zfV1MB5ptF9eAKKoyt9kQMYLuuXvkOK0nNC9Yd0CZOcptZZ+XP7 icoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770204593; x=1770809393; 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=zqOiwAx1+q0FKyReAOUgZRpz2E1HnCP+W30z4rd0Qx0=; b=iCZSfg+c1BeYjsAlYy6C7KS5yKYTItrwBFGgxGBGlXt43bClDGqGgJFZf2MZuUAhKU xOkC/r2fCubUC7TgmowMGRkIy2uRUfkWGcx6zpalQD0AgGs5tmj1HpMrybrsPF+/oGm8 orzCJ8vs8oR5RAi+23Jc8hGYf4Gj8pDbeVfr0WIvz7BsUWb1yf0VSEP1Wkt7w3Z6sICR ngD5P7HrZdCXYqptgRzlRat8yADew08BBKTCPbne4VDpAo+FDZSpJ++jcKlsOfNK5U7w 38pKkj8nCYV1vxTFGhS2Dd++URxYyWxPE3KOjRTv8n8zOUjdnvkmUfIpfa2wr7iCRcv4 U0EA== X-Forwarded-Encrypted: i=1; AJvYcCXiAFWs8JHRftHmtnpZTNQFqiBaKGY5J5G0k0+hA4wIXXVRi79DnydJe/8SV4nXwsfC2QcRGGIObJY3W/E=@vger.kernel.org X-Gm-Message-State: AOJu0YwFF7l442CUaILVzGxEXkIfJCMryscNyO2qXyrBz3Mgs2Yv/MbM ZEjeIn8zxhEoASRjGuU35LGEn+Dl69igI8Yr1I/Jgl41B9a+GwkskMylCPg37F8yyGAoAqUveJE yoHh8A7xyC4Jf/DcGKfW45MCI+p2UYUGP2w0qdJ0m1HCb4ks9SOukblpUOpOCiLyJ5Q== X-Gm-Gg: AZuq6aIqkwb3vJtDXzc+P1ZmvUgUfrAY5FxMRkM2l79/xkXYY+hNkugzCDZc0ehnjvO X5NaxuJFdgwNYtEa+CBcJzd2cD6V6fV/7BxFPC7jaEuLKywN1LbdAGAh8I+IM/dZHekYehx2p3N wVreYvo8EzRIPE5hn6xIvIbIfqqEIGVsndK8oPKUJEmWrDYfNkxN8021xNaFGB2Jb8UuCsItNAP LDbsmesVoyeQZj06WgNyYRcixFdowlHnUn6Y2oEMqV7keLHqUqt8drLcZsQy733YYsbVeAm0dAT QapD11ntP4o7bSDVnzLvunedBEtq62WLVvcvIvuzsePWZVoyN6Umb5yGApibxlVnAh8ZDN4k8tL fqWapCI++ujgaciN3AS9x5v/AdSYOSV0pXkD3AnoYcS/mC+vPAsT9WI/bwow= X-Received: by 2002:a5d:4573:0:b0:436:1989:46b7 with SMTP id ffacd0b85a97d-436198946c7mr2085562f8f.15.1770204592618; Wed, 04 Feb 2026 03:29:52 -0800 (PST) X-Received: by 2002:a5d:4573:0:b0:436:1989:46b7 with SMTP id ffacd0b85a97d-436198946c7mr2085507f8f.15.1770204592143; Wed, 04 Feb 2026 03:29:52 -0800 (PST) Received: from sgarzare-redhat (host-82-53-134-58.retail.telecomitalia.it. [82.53.134.58]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43618057f87sm6371139f8f.21.2026.02.04.03.29.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Feb 2026 03:29:51 -0800 (PST) Date: Wed, 4 Feb 2026 12:29:44 +0100 From: Stefano Garzarella To: Arnd Bergmann Cc: Bryan Tan , Vishnu Dasa , "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; format=flowed 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(-) Not sure if it's net or net-next material, maybe net to avoid the warning/error on v6.19 too ? Anyway LGTM and thanks for the fix! Reviewed-by: Stefano Garzarella > >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 >