From patchwork Sat Dec 1 01:08:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 152617 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4320705ljp; Fri, 30 Nov 2018 17:08:52 -0800 (PST) X-Google-Smtp-Source: AFSGD/X3zBNVPDkt1qprhWEjdRN3/SaqVyQkF5HdEyYB4eGsGDv8MqrVh+WNJH4nyc33dIvceAQE X-Received: by 2002:a62:870e:: with SMTP id i14mr7912270pfe.41.1543626532170; Fri, 30 Nov 2018 17:08:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543626532; cv=none; d=google.com; s=arc-20160816; b=HMYc8q54+Pi6M7yzsGFVEzbPX/O4U2qIvyV2nlK2GLJSyQXcVsm8cq5YLJUE4OPX5g vLJwazChrPPmehqwDrOWeFXQRMQrvQTxX2d7fZc5a08Oejfm1j9JMA6vhzu0EhBUdAdR 7+hqbsAVJ8pUPJfhQwzPaEixmwmEYwJCqioGYHP0EKq+fMG4t/R/UdPqBR+qyheFQTmI JF9vVRJIn7VbtLKJ7rF296iLJjgNHeHEN8vJeaAWKfvxJjgyPnpniaky4gQflBg45XR/ KCpWcQGOTy5eSxAlgnvj2j6Qa2g3lXek8AqaAGlArZWVX0f1oDbypXcwvJVrw9D9t4XD aF9A== 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=smf5o1hkArz/cMTX0vA5gyDeD14nSwq9nxP+D33nRLg=; b=nJigIeC6mP1ZP7Ni9i4jnJptJ5PrrgUcu2DdJLstmxJA7veh8MOFBokcAI1FvhyexY ELd7FgkMFw92cduIj4C5mAFV4PTaDOWxFEtKbRXh/wmT/xJqAhUwEyRbphZnjgtNIqQj xDxYDU/HD82zA/0dgUctYWznaxb5rFkEstrLdoLd6ty+c9sipn/lxBG3kUhnAo4EyZU0 qASpfYlzDtGLnlraXa7JEu5yNWAlN4BnoCIZo/oN5BJyagv+a+y5D7cOHFU1wcawmk/Z AqIfEJz0q4dI9ZEzTgrLHH94BuB2kZg0vNbX0B96UaQgpPBWYg25hg6Ev/HhrYO7rryq HGtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=OQVHg3si; 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 k25si7250512pfe.10.2018.11.30.17.08.51; Fri, 30 Nov 2018 17:08:52 -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=OQVHg3si; 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 8B9EE6D826; Sat, 1 Dec 2018 01:08:49 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by mail.openembedded.org (Postfix) with ESMTP id E97476C48A for ; Sat, 1 Dec 2018 01:08:21 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id gn14so3595662plb.10 for ; Fri, 30 Nov 2018 17:08:23 -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=Ivi+Gix/9Ax0sm/1ri4b50ufhsEJbVmzh6xtBEk7ck0=; b=OQVHg3siCRXvkb0ksvXIFWXF7/cDkxdGL/E9AmxTEjrLNPH2i63ExcJbH09lHd4ZNz iwl3lNk6kLUPvhV89+B+Ol0lTEEg1fAEsjp1SgT1AYC9Bc8Sp+8r8I/RfWLAY/tCpbqT 0IETg44RQXYAoNM9p5gDkpWqhuOJzGSe9EuO4xwIPhLDb+nklmBK0lfrVpmIYhn5spiI ojC9Nn4n4gsS5mMgcCMHmESsqFAYDhM/hef+QTDb2DpLFbHbVwgoQ2xpyPsPmS5NtzSv QZGTufxccXKtj6G7xTX4/Q1MhBazEotrCspOzZIR6yoslJpxpZaclCP5BOfIk6khVFWX ZOMg== 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=Ivi+Gix/9Ax0sm/1ri4b50ufhsEJbVmzh6xtBEk7ck0=; b=bzHnpK59qmHYtKcDAq3FwaIxqdM2z2R1PnKfrke7ioCn+aC/Ek7KhbbQ+CmRtHLPuA belSJhKtZNaWFNSJcDpkmE2Rxc/mkDO+zSFqOV4Rf16QrdEamcbDegir+MOvqHRVpYWd rXLR9j60iKtR0MEZGkIaYQMVxGrRFfKiSrBoziAZmZyRzpCIIqlCwEY6nemXBFJrMXBf qBpthvxfgwgBZbCvkKVShcsZSJOSaNG17TTs0on/d+hV9mhAolML9T8o+DHG5kuHhp8l EEZGelhMSqkkNbkRY9Lpf3dAArsrtVReVUKvNUFYKLs9ZYBJhj/RJ+wemKqa8Q4oZeAM cSGQ== X-Gm-Message-State: AA+aEWZWbiQmIgHl8BIaoxbe0qJI4MmAoi/Po8CbpOFvzCnPMn/SMBXI 8KXAF03LHMfh5+aEr95t8eK2Ct/KbZw= X-Received: by 2002:a17:902:30a3:: with SMTP id v32mr1889810plb.26.1543626502537; Fri, 30 Nov 2018 17:08:22 -0800 (PST) Received: from localhost.localdomain ([2601:646:877f:9499::26ab]) by smtp.gmail.com with ESMTPSA id q199sm18683422pfc.97.2018.11.30.17.08.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 17:08:22 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Fri, 30 Nov 2018 17:08:07 -0800 Message-Id: <20181201010807.28924-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181201010807.28924-1-raj.khem@gmail.com> References: <20181201010807.28924-1-raj.khem@gmail.com> MIME-Version: 1.0 Subject: [OE-core] [PATCH 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 --- ...ot-pass-null-pointer-to-freeaddrinfo.patch | 32 +++++++++++++++++++ .../nfs-utils/nfs-utils_2.3.2.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.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.2.bb index 5c0586fa75..9b3f36d343 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.2.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.2.bb @@ -30,6 +30,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x file://nfs-utils-debianize-start-statd.patch \ file://bugfix-adjust-statd-service-name.patch \ file://nfs-utils-musl-limits.patch \ + file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \ " SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"