From patchwork Sat Dec 1 18:12:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 152646 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5055074ljp; Sat, 1 Dec 2018 10:14:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpDGr52tDo3ip+GSkBJ5Cl0aTlKdjxlAnta8hUUSGQPGrnwXYK8sqvwyDr7HAGv6ysyRxC X-Received: by 2002:a65:55ca:: with SMTP id k10mr8387852pgs.448.1543688083557; Sat, 01 Dec 2018 10:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543688083; cv=none; d=google.com; s=arc-20160816; b=cZotTas7lZa9waftYeV+xxTTtwXYi25oPVUrU5ZqLWwtrTsQq2IkPuBrco9Er7Iuqd AqQXR78g3/CsGo/hAqnuYiL62t0kqIUOiuJehQYxOe4mV/hEomjVYwphoOUVGkMjSgV2 GG+1boLSo2T8dPJVHVDrMtTHp/ue6IzDc2pG/bmmgULDd9ErT1Q8nUHVeym/0yEic2CB svh/5fhjthOCrD5C5xLkROZRB3Zxo/TjOFtTcbPkFnyPy73RtsbOVPK7/LHMPMw9MLIc CLOLRxRVEO41BpGXAE0zZkekZKAmQq8ihQRYtI0U14/lxagZScrribKmNBLEucxwgCv5 uWsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=Y4H5MErwmasTJvK5E1tlgsU/wU1sfxTTi9GIfNE27pI=; b=KEQ9zgBjTSmOiKH5bsvLpPC17Mvrl9XtgcQhgW47j7OIzqWYC4exoviVsG0Fe09i+0 CaNvSUoVC07z5OL2bPhpLfL/wqjSGmK2LDRtVpb0Ot5fkWpeOwF/RWheHOZRGfd4Z9Xw hpYivFtQUOYebfuKOJejClg/5D45A6e1D8HbFlCU4xnMSj6PZVDFcd6z62wGGN5okCik 7mInHOevXjH++Jq2xWDBuxghAuHYuMaCJvf4MHnZ6jEqB6V9ajCDfrNDlbktQA0opGAG BP8YLWElJjFauLC78hXpR19436Q+hw0Rl/9w8HjN7fdg/kxClLioRrIcZc3MlHtmNyfg f7ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=nDYOwX6A; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id o10si8510725pls.76.2018.12.01.10.14.43; Sat, 01 Dec 2018 10:14:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=nDYOwX6A; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from 165.28.230.35.bc.googleusercontent.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 942D26D460; Sat, 1 Dec 2018 18:14:40 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by mail.openembedded.org (Postfix) with ESMTP id 874EC6D435 for ; Sat, 1 Dec 2018 18:14:23 +0000 (UTC) Received: by mail-pl1-f195.google.com with SMTP id gn14so4385496plb.10 for ; Sat, 01 Dec 2018 10:14:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rptVzVcudWWMemoJ7mp4Wrq0Htfxb84ondzhHKp3kdU=; b=nDYOwX6Asus9mCcmPU3/RriRhhJVwNZk+Q3WUWHL/CWEepW/y/D7o9rzZ60MCUZ7MR HUJQSuK/CPlUmlcbLyQT6KUH2lPdEBx4zxqWaDQySsy2jWeHQ0d2542zDNJQJeCjl8kM 6LhXYRX5RkpikjxOP+6zZRQVnM7xO2lHNev9qD0zJK9kJfe3dHsu74Q1IpuboA/Vi8gt XLmS3ISOp5cwm/VTMN5TGHK8quZNFIpdWOcbCZmx/GNCubuMicuFb0IUeyo3BnrlBq5H 7q2shRmN/8nYQxWpuJFQrLFF+NAjWr6FKi2FnVnmUePGjbeKFstMH7FONQgHEeEcTLAA aZCg== 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:mime-version:content-transfer-encoding; bh=rptVzVcudWWMemoJ7mp4Wrq0Htfxb84ondzhHKp3kdU=; b=kx9qnU1z2ZP4svkAWgavPw1Xjq8wXsjQ+vGwZyUiM2KX20nyx6jTw47+G3MR+WRt1N FMXfUMoehPaMH+6fgCrpTZrTdPOQDpRSW5npW2e2N6sf7wcBFJNut1HDCmSbVjKw/QYW sbncGTilNwRYjo/9JTJQYdGYUqd312iT7OayDNqWFq112OEfFhK8/Xql9n1kNoFvgsaw ovl0AeToUJNXGeNH+T+sWJ6iMAx6oSjpXyefKBNGLx75uTA2fnHuiQHvzspmgDtMAcH6 ujwP40WhzOAJKxuKtWKO2UBFnK1OcgPsb0am7j5W9VtUE/qdTnL12LKUmvzWkvzbGp0t 4GVw== X-Gm-Message-State: AA+aEWbGWw4FgoHTckfKZKo1iOEH0ofnzgQ48Fx6CuxGJFq0ny0/sEXr NCjp8VCA9Rf5DrBg6JG/Hmbz0qgNHAk= X-Received: by 2002:a17:902:e08b:: with SMTP id cb11mr10203246plb.263.1543688064235; Sat, 01 Dec 2018 10:14:24 -0800 (PST) Received: from localhost.localdomain ([2601:646:877f:9499::26ab]) by smtp.gmail.com with ESMTPSA id t3sm8949728pgv.31.2018.12.01.10.14.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 01 Dec 2018 10:14:23 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Sat, 1 Dec 2018 10:12:54 -0800 Message-Id: <20181201181254.42701-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181201181254.42701-1-raj.khem@gmail.com> References: <20181201181254.42701-1-raj.khem@gmail.com> MIME-Version: 1.0 Subject: [OE-core] [PATCH V2 2/2] nfs-utils: Fix exportfs segfault on musl X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org Signed-off-by: Khem Raj --- V2: Rebased ...ot-pass-null-pointer-to-freeaddrinfo.patch | 32 +++++++++++++++++++ .../nfs-utils/nfs-utils_2.3.3.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch -- 2.19.2 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch new file mode 100644 index 0000000000..a44d1bf2fe --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch @@ -0,0 +1,32 @@ +From 4f115fc314646500f7b4178d7248a02654c7cd10 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Fri, 30 Nov 2018 16:47:57 -0800 +Subject: [PATCH] Do not pass null pointer to freeaddrinfo() + +Passing null pointer as input parameter to freeaddrinfo() is undefined +behaviour, some libcs e.g. glibc might just call free() which does +accept null pointer but other libcs e.g. musl might not and instead +cause the program to segfault. Therefore do not rely on undefined +behaviour instead make it deterministic + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + support/export/client.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: nfs-utils-2.3.2/support/export/client.c +=================================================================== +--- nfs-utils-2.3.2.orig/support/export/client.c ++++ nfs-utils-2.3.2/support/export/client.c +@@ -309,7 +309,8 @@ client_lookup(char *hname, int canonical + init_addrlist(clp, ai); + + out: +- freeaddrinfo(ai); ++ if (ai) ++ freeaddrinfo(ai); + return clp; + } + diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb index 35587dfb7a..572ae3146f 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb @@ -31,6 +31,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://bugfix-adjust-statd-service-name.patch \ file://nfs-utils-musl-limits.patch \ file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ + file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \ " SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"