From nobody Mon Feb 9 18:45:57 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=@amazon.de; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=amazon.de ARC-Seal: i=1; a=rsa-sha256; t=1614350568; cv=none; d=zohomail.com; s=zohoarc; b=T4uA7SFuU5d3+pjLUgyYCxsZQzPP1Fqlvmy7bUxXnLWFhqVTcHOB9PedT+AYIFYEgk5cR3sX63C6b4i0eOLwm31UvTXpFUDvzKvFt7kxI7gJwkqvTRzWMZWUQ6E1YUvKnCHQ1IeNiX3Xz2UvV4GO3Q5YUfbUgUtZ/mRZ8INiQXQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614350568; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aupOUlFlXdRu4KMtyn+0J4vkXjNtTUzjaeSxjmikpeI=; b=iaL2IMhBdFF2SbPkpaE3pdvOhm/H5J9tpJEuR1wYv7U/0lGwHrDUTGeiuos3hck9AQGTL9+elrWEIdalYizvy4yfpSnZS2AyxA6vSzVCubfUSOzsiL3V6kBxclq6H26oprmj2AFEJ5NHbEhuyAengXDTqdqjCR1LbG9X3aE3csI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@amazon.de; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1614350568053791.1765212184512; Fri, 26 Feb 2021 06:42:48 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.90354.170992 (Exim 4.92) (envelope-from ) id 1lFeKB-0003PZ-VZ; Fri, 26 Feb 2021 14:42:35 +0000 Received: by outflank-mailman (output) from mailman id 90354.170992; Fri, 26 Feb 2021 14:42:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lFeKB-0003PN-R8; Fri, 26 Feb 2021 14:42:35 +0000 Received: by outflank-mailman (input) for mailman id 90354; Fri, 26 Feb 2021 14:42:34 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lFeK9-0003Af-WF for xen-devel@lists.xenproject.org; Fri, 26 Feb 2021 14:42:34 +0000 Received: from smtp-fw-2101.amazon.com (unknown [72.21.196.25]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 2894b2c9-2b51-40ed-9e89-1632ac5f3a26; Fri, 26 Feb 2021 14:42:33 +0000 (UTC) Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-16425a8d.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP; 26 Feb 2021 14:42:25 +0000 Received: from EX13D02EUB004.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-1d-16425a8d.us-east-1.amazon.com (Postfix) with ESMTPS id 12398100C47; Fri, 26 Feb 2021 14:42:24 +0000 (UTC) Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX13D02EUB004.ant.amazon.com (10.43.166.221) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 26 Feb 2021 14:42:22 +0000 Received: from u6fc700a6f3c650.ant.amazon.com (10.1.212.27) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 26 Feb 2021 14:42:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Inumbo-ID: 2894b2c9-2b51-40ed-9e89-1632ac5f3a26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1614350553; x=1645886553; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=aupOUlFlXdRu4KMtyn+0J4vkXjNtTUzjaeSxjmikpeI=; b=GlBHrEWZnEBl7CZdRlCi/dpGEnXRCr3W49Sr1Q+fcVKrwc3SiVTmdbqs 8sBRbLbYPYv5VbC11GhmEhLN/0NKTHrnlp+FcFc5UxzUXJzWjX4rbWwKw yzsHP60SQ0dOKc1lP59qbFv4IMRU8qSd9QMQVC6BKZtshvLqowTz1Lclh 8=; X-IronPort-AV: E=Sophos;i="5.81,208,1610409600"; d="scan'208";a="88504713" From: Norbert Manthey To: CC: Ian Jackson , Juergen Gross , Wei Liu , Julien Grall , Michael Kurth , Norbert Manthey Subject: [PATCH XENSTORE v1 05/10] xenstore: handle daemon creation errors Date: Fri, 26 Feb 2021 15:41:39 +0100 Message-ID: <20210226144144.9252-6-nmanthey@amazon.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210226144144.9252-1-nmanthey@amazon.de> References: <20210226144144.9252-1-nmanthey@amazon.de> MIME-Version: 1.0 Precedence: Bulk X-ZohoMail-DKIM: pass (identity @amazon.de) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In rare cases, the path to the daemon socket cannot be created as it is longer than PATH_MAX. Instead of failing with a NULL pointer dereference, terminate the application with an error message. This bug was discovered and resolved using Coverity Static Analysis Security Testing (SAST) by Synopsys, Inc. Signed-off-by: Norbert Manthey Reviewed-by: Thomas Friebel Reviewed-by: Julien Grall Reviewed-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_cor= e.c --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -1996,6 +1996,9 @@ static void init_sockets(void) struct sockaddr_un addr; const char *soc_str =3D xs_daemon_socket(); =20 + if (!soc_str) + barf_perror("Failed to obtain xs domain socket"); + /* Create sockets for them to listen to. */ atexit(destroy_fds); sock =3D socket(PF_UNIX, SOCK_STREAM, 0); --=20 2.17.1 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879