From nobody Sun Feb 8 23:42:26 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1527816651493863.8724573062129; Thu, 31 May 2018 18:30:51 -0700 (PDT) Received: from localhost ([::1]:46896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOYu2-00051j-H4 for importer@patchew.org; Thu, 31 May 2018 21:30:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fOYqs-0002wm-Mq for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fOYqo-0002qE-T6 for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:34 -0400 Received: from mail-qt0-x243.google.com ([2607:f8b0:400d:c0d::243]:37548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fOYqo-0002pr-OE for qemu-devel@nongnu.org; Thu, 31 May 2018 21:27:30 -0400 Received: by mail-qt0-x243.google.com with SMTP id q13-v6so30303423qtp.4 for ; Thu, 31 May 2018 18:27:30 -0700 (PDT) Received: from localhost.localdomain (96-86-104-61-static.hfc.comcastbusiness.net. [96.86.104.61]) by smtp.gmail.com with ESMTPSA id o68-v6sm2003842qkc.19.2018.05.31.18.27.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 31 May 2018 18:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juliacomputing-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=P2b6eNHIwBEVaKG1WtWdNoOELbPgOnDMY56CVCNFFNY=; b=ZlPFJVRMvxmLi9uF86Bxd9y6X01WfV8Cyj2qrtgWUTB7tY9T08yVfGFEI4QUKVME1s s3no73HlFUxwVyR5zIOLv/o9jUzIN2zcPfnjcAqoxUK1MopIwusJLHcHarpeZoo+gqV8 Rfst9KiyPA7AJsrjdtO0RFG9vERx1InZxQLLCsipAqEZciQOQS3IR8Z1mqfhg1oMI1Co By0TGUAoiC032wtG4YW2kMK6PIVFKtqtue27PCXj1cc0hbW53dm1SsjOf5Mf8tYDry0m 9nH4sk5XsoeIE4n+SXiKnHmU0NXstmgRtLd3TtVBwnb5hJ5dzNGZqeHdtrpAXHu21wZc 5nmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=P2b6eNHIwBEVaKG1WtWdNoOELbPgOnDMY56CVCNFFNY=; b=lt3l+Mvylk4xnwnVmYV260AZcjoKR4z3deKHnzNcI6D/eIcmWkRPCWKwwB5f5L3Xbl V3cywK+dil1QZl2YdR0y6fC/aqDsGxkDoIDYcU7dz4rZ7rE9uR2+ejguYVT7ZM5BNzQW Gc88zpfRaDYsoh+NVDBi6RYQAUKA7JFK8x/n6QEU26NanjC0NLxNtrUGFsd8gUm4gLOk SVL3JEVTalJRHGGezL59ZgwPFBuHzYLjnF6vBm3o3UUT4S++2z3otxLvNsnAF2mlI5x9 SW/iaakYQPvPXorLcYtulxr6lXg4c+jtXwpwrpuxDajLU41/pN+a2TNre6+RyYGbaRC3 HAUA== X-Gm-Message-State: APt69E3xMZYZYRlvCmOGSbnSWPIpV5gStEN4blQmpvNOmmF5R/Eybsxb qYTy1lIpd9LOJ/JVw0IJy4QBVPphU1Y= X-Google-Smtp-Source: ADUXVKKCPqPmEKWmlo+KK+RI0e2R86rkt+RM/EBbtGI8RY86ajOMxfB1GnWgS2bfKeuG1S3gns0KOA== X-Received: by 2002:a0c:c242:: with SMTP id w2-v6mr8434807qvh.91.1527816449786; Thu, 31 May 2018 18:27:29 -0700 (PDT) From: Keno Fischer To: qemu-devel@nongnu.org Date: Thu, 31 May 2018 21:25:57 -0400 Message-Id: <62bbed45cc9c775ba23cd5572e8cf2d77d769dfb.1527814874.git.keno@juliacomputing.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::243 Subject: [Qemu-devel] [PATCH v2 02/20] 9p: proxy: Fix size passed to `connect` X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Keno Fischer , groug@kaod.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The size to pass to the `connect` call is the size of the entire `struct sockaddr_un`. Passing anything shorter than this causes errors on darwin. Signed-off-by: Keno Fischer --- Changes since v1: New patch hw/9pfs/9p-proxy.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p-proxy.c b/hw/9pfs/9p-proxy.c index e2e0329..47a94e0 100644 --- a/hw/9pfs/9p-proxy.c +++ b/hw/9pfs/9p-proxy.c @@ -1088,7 +1088,7 @@ static int proxy_ioc_getversion(FsContext *fs_ctx, V9= fsPath *path, =20 static int connect_namedsocket(const char *path, Error **errp) { - int sockfd, size; + int sockfd; struct sockaddr_un helper; =20 if (strlen(path) >=3D sizeof(helper.sun_path)) { @@ -1102,8 +1102,7 @@ static int connect_namedsocket(const char *path, Erro= r **errp) } strcpy(helper.sun_path, path); helper.sun_family =3D AF_UNIX; - size =3D strlen(helper.sun_path) + sizeof(helper.sun_family); - if (connect(sockfd, (struct sockaddr *)&helper, size) < 0) { + if (connect(sockfd, (struct sockaddr *)&helper, sizeof(helper)) < 0) { error_setg_errno(errp, errno, "failed to connect to '%s'", path); close(sockfd); return -1; --=20 2.8.1