Message ID | 20211221173910.2405214-1-stijn@linux-ipv6.be |
---|---|
State | Accepted |
Delegated to: | Stijn Tintel |
Headers | show
Return-Path: <openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=vU0jXTzj; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux-ipv6.be header.i=@linux-ipv6.be header.a=rsa-sha256 header.s=502B7754-045F-11E5-BBC5-64595FD46BE8 header.b=dXUW6ZYO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JJP0X6Bs0z9sR4 for <incoming@patchwork.ozlabs.org>; Wed, 22 Dec 2021 04:42:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=bLndzq7k237A7M9WSSoKOic+yuAcH06TmEzceYArxzs=; b=vU0jXTzjJBNyCB X6J0WXCvEQBODW87ILExdnKWkA4SR8GjPDA+BvKRFzjp3ajPbk/0I7dODyOQWD5UBxvLJuix1hQTq Xl78CsWO9NIugel2VNigXaLVigLIq2phgIG8S2dBtWpaBs4FL8cRFHdzDWCw82pUqREdZzPo7loGZ cfblxWzwjzoXxmANOi+jstyoa5rLvghSESpGijyKBWAcMIh5hQ9qAaxI/k18b+iRwvQRxBb9RcagP gZLAPIKgF/n3nC3khlNR8U4cUwP+lpEPT02JXPZ2DIG3Bc/IRnHHInso1d/sAsQr+EfDnyehOwnUC Xyvs3uN6H4vNJQ3Vj1Wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzj6d-007tYf-6d; Tue, 21 Dec 2021 17:39:19 +0000 Received: from mail.tintel.eu ([51.83.127.189]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzj6Y-007tXR-Tm for openwrt-devel@lists.openwrt.org; Tue, 21 Dec 2021 17:39:16 +0000 Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id 47576435B4E4; Tue, 21 Dec 2021 18:39:13 +0100 (CET) Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id EKGOqM01_iVr; Tue, 21 Dec 2021 18:39:13 +0100 (CET) Received: from localhost (localhost [IPv6:::1]) by mail.tintel.eu (Postfix) with ESMTP id E409B4475419; Tue, 21 Dec 2021 18:39:12 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.tintel.eu E409B4475419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-ipv6.be; s=502B7754-045F-11E5-BBC5-64595FD46BE8; t=1640108352; bh=WyOKo1W4RveWhKPpzqyxaNgXJixdzBR8bIZAINhaS6Y=; h=From:To:Date:Message-Id:MIME-Version; b=dXUW6ZYOvT4factPlLsRaWSoQ2+lGXstnkWmSVOUc+NFluKg/KIqmqbf7R7G8Ft4C 747WnaQ0HiXcm73dsX6V5sUMCBsilLoKSn/5wPTH6mSdf8MmrYdQviPeUtNJ/VS+ED fTtJegzMuoFTFwTSvLqrhJhvjChDAhd8lSgLZXvo= X-Virus-Scanned: amavisd-new at mail.tintel.eu Received: from mail.tintel.eu ([IPv6:::1]) by localhost (mail.tintel.eu [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id d6tfW9WSUDz9; Tue, 21 Dec 2021 18:39:12 +0100 (CET) Received: from taz.sof.bg.adlevio.net (unknown [IPv6:2001:67c:21bc:20::10]) by mail.tintel.eu (Postfix) with ESMTPS id 41656435B4E4; Tue, 21 Dec 2021 18:39:12 +0100 (CET) From: Stijn Tintel <stijn@linux-ipv6.be> To: openwrt-devel@lists.openwrt.org Cc: john@phrozen.org, daniel@makrotopia.org Subject: [PATCH fstools] libfstools: avoid segfault in find_mount_point Date: Tue, 21 Dec 2021 19:39:10 +0200 Message-Id: <20211221173910.2405214-1-stijn@linux-ipv6.be> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: IP_WHITELIST X-Rspamd-Queue-Id: 41656435B4E4 X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: IP_WHITELIST X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:200533, ipnet:2001:67c:21bc::/48, country:BG]; IP_WHITELIST(0.00)[2001:67c:21bc:20::10] X-Rspamd-Server: skulls X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211221_093915_126595_2556B9C1 X-CRM114-Status: UNSURE ( 7.03 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: If block is NULL, find_mount_point will segfault when comparing it against the device name found in /proc/self/mountinfo. Avoid this by checking if block is NULL. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> --- libfstools/find.c | 3 +++ 1 file changed, 3 insertions(+) Content analysis details: (0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.1 DKIM_INVALID DKIM or DK signature exists, but is not valid X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org> List-Unsubscribe: <https://lists.openwrt.org/mailman/options/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe> List-Archive: <http://lists.openwrt.org/pipermail/openwrt-devel/> List-Post: <mailto:openwrt-devel@lists.openwrt.org> List-Help: <mailto:openwrt-devel-request@lists.openwrt.org?subject=help> List-Subscribe: <https://lists.openwrt.org/mailman/listinfo/openwrt-devel>, <mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "openwrt-devel" <openwrt-devel-bounces@lists.openwrt.org> Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org |
Series |
[fstools] libfstools: avoid segfault in find_mount_point
|
expand
|
diff --git a/libfstools/find.c b/libfstools/find.c index cefdd23..1d91c51 100644 --- a/libfstools/find.c +++ b/libfstools/find.c @@ -109,6 +109,9 @@ find_mount_point(char *block, int root_only) int rstat; unsigned int minor, major; + if (!block) + return NULL; + if (!fp) return NULL;
If block is NULL, find_mount_point will segfault when comparing it against the device name found in /proc/self/mountinfo. Avoid this by checking if block is NULL. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> --- libfstools/find.c | 3 +++ 1 file changed, 3 insertions(+)