From nobody Tue Nov 26 08:48:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1709120928; cv=none; d=zohomail.com; s=zohoarc; b=Yyocv2BM9lRIJQgnlWQx0Rj1guB8XNK8dYDSV1dTu61ICWDfCjWiZ/zTHkCJyfDD0p5cBPrB8NxO9POHc1kl0+PJhxx+SOJ9O4hPbbRSuESwwaF9HIVoqX2lXGMG8ba7FTHU5/SkvIUp38TeiPfybfUaPl7h+NcTxspUE+X8Pcw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1709120928; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1MgJ0yPm3ToTqOR/tn/By3XWvH0ZNAU51N+FqVYYj+A=; b=IpIxkC+YoSx6t2EoWTsVza73piobygxlhh+2Gi8hrYHuA5isbF6rDUpxIxgYZJ2+FGP6/W+xWY3PH3CldGQNW6PGRfW4zg2CykKkdvvJ+mabTmZ2Y6ZmLXipGM4JDA2ZYXrIB6KDp52+UCclBAouhckvfquVaD2mFvJ0opY2AxY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1709120928038699.720978327009; Wed, 28 Feb 2024 03:48:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rfIQR-0002Rd-QV; Wed, 28 Feb 2024 06:48:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfIQ9-0001yt-KW for qemu-devel@nongnu.org; Wed, 28 Feb 2024 06:48:24 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rfIQ5-0002yB-Hl for qemu-devel@nongnu.org; Wed, 28 Feb 2024 06:48:21 -0500 Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-48-bub-RQRTP4Ge1EjB9H71Pw-1; Wed, 28 Feb 2024 06:48:14 -0500 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-68facaf1c37so63772696d6.2 for ; Wed, 28 Feb 2024 03:48:14 -0800 (PST) Received: from step1.redhat.com (host-82-57-51-64.retail.telecomitalia.it. [82.57.51.64]) by smtp.gmail.com with ESMTPSA id og17-20020a056214429100b0068fe3170b0esm5168982qvb.11.2024.02.28.03.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 03:48:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709120895; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1MgJ0yPm3ToTqOR/tn/By3XWvH0ZNAU51N+FqVYYj+A=; b=NTUCzFSBeENMQ0pw1IpyjPUIIMJuqu74x0lCZBjjLq7Xt+MYEplaWl7gd8o9UWGFHfephI wDKhbUmqhhFz+L9zyQDrW/eDxm1NcSc/J7ZUWGVd6rfGu7GBZVPzGYvKjV7cuS1N1CMo0A ropuwsX/s/MY6FuOYPc2XLJ67DK7H3A= X-MC-Unique: bub-RQRTP4Ge1EjB9H71Pw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709120893; x=1709725693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1MgJ0yPm3ToTqOR/tn/By3XWvH0ZNAU51N+FqVYYj+A=; b=eQayJ3l2ojGJXXWglfbA8E28xy2jHdbYDY2gMomvRfWHFPe2oknbvTFNT0IrPhudkR UgarQlMrfaLL1gfhm6QULxfvt9EEIHooT4kICMUuMCP42tRZNkjIbmZD6l0dxrJUSF1R kBcnDlcDPJL94QJytsCA9yosY85xeoqaLpR+VZtgwxGySeHg+fgU4roXxjD85abmfVaz hjYZKAdhD1sXkvqWom1WzQYMMI409MXkg8OVvQWSm1NWxYJNEUeFVLCdmBnOCh7ybVfV 9Q+d99djd3RD7HTf28++I+F1OBaFQ+lm/jy4sRQHHMtJpr4pylVQuYJYDuXHtqy88Sw4 JozQ== X-Gm-Message-State: AOJu0YyA+g7CrWvEDUcqNKk7NAxVFIN4+Rwwc5/BFNhmOVldMJ/Ra8wO i3I9MhuMhHzDx9/2bh6LftujpE6g8pkyOCqpXjJmeT3+5ZGbEhjrl82ZnG1AwlY5aZmu14ruuAG ngqyGIkztRLSr5mXdry5NZxtJlY0WnMK5TA3LLXptjVy/a1BroX21aa9lA0U3iru6HYrDgIdNlc 9Rzv2u3mvuMIr2CScTqi5sGoi+QB7QfyEANHhQ X-Received: by 2002:a0c:b55a:0:b0:68f:3a7b:acde with SMTP id w26-20020a0cb55a000000b0068f3a7bacdemr5767703qvd.41.1709120893531; Wed, 28 Feb 2024 03:48:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFh5j+33195MLcwMYVLgDq21ulPQrd9yO0i820OvlHkq7/w48sElOO7s98RYQZETG5tvWX6/A== X-Received: by 2002:a0c:b55a:0:b0:68f:3a7b:acde with SMTP id w26-20020a0cb55a000000b0068f3a7bacdemr5767668qvd.41.1709120893157; Wed, 28 Feb 2024 03:48:13 -0800 (PST) From: Stefano Garzarella To: qemu-devel@nongnu.org Cc: Paolo Bonzini , qemu-block@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , "Michael S. Tsirkin" , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Eric Blake , Coiby Xu , slp@redhat.com, Eduardo Habkost , Hanna Reitz , Igor Mammedov , Raphael Norwitz , Kevin Wolf , David Hildenbrand , stefanha@redhat.com, gmaglione@redhat.com, Stefano Garzarella , Stefano Garzarella Subject: [PATCH 1/9] libvhost-user: set msg.msg_control to NULL when it is empty Date: Wed, 28 Feb 2024 12:47:51 +0100 Message-ID: <20240228114759.44758-2-sgarzare@redhat.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240228114759.44758-1-sgarzare@redhat.com> References: <20240228114759.44758-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=sgarzare@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.102, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1709120929586100002 Content-Type: text/plain; charset="utf-8" From: Stefano Garzarella On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Signed-off-by: Stefano Garzarella --- subprojects/libvhost-user/libvhost-user.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvho= st-user/libvhost-user.c index a3b158c671..b9c18eee53 100644 --- a/subprojects/libvhost-user/libvhost-user.c +++ b/subprojects/libvhost-user/libvhost-user.c @@ -387,6 +387,7 @@ vu_message_write(VuDev *dev, int conn_fd, VhostUserMsg = *vmsg) memcpy(CMSG_DATA(cmsg), vmsg->fds, fdsize); } else { msg.msg_controllen =3D 0; + msg.msg_control =3D NULL; } =20 do { --=20 2.43.2