Message ID | 20231118-dnsmasq_drop_ubus_null-v2-1-1e1f1f7ab251@narfation.org |
---|---|
State | Accepted |
Delegated to: | Hauke Mehrtens |
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@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SXd6427hCz1yS4 for <incoming@patchwork.ozlabs.org>; Sun, 19 Nov 2023 02:31:24 +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:Cc:To:Message-Id:MIME-Version:Subject: Date: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=Q8enXsvrkyfNW3FlRjdrzJCWAIUcjxyRLSF6NYcb+Aw=; b=z9GN8FOkelG9rH F9i1x91hm7N7KRppPoptWXqQidUCr0xl8YQR7N8gCnkWAffIjk8pWKgWqYUtNZaTytHUNd4gWH0LT 4sQc+XbPb1diwOMn47J9Nsh5VjgJyAq88CUinvz090BqeDobZwZrTbd5rbioNqHQ+92ET3cwU/cwT 2xmXKC3BkUsKM4dyjC82he/dwJvNwLmNHufShFcWHsEda68chU9Q4Vobuh8BDredPxpuhaprNncqo nhtf4je3HqMxp3/rdd13Itnig0l7F86Wcghkqerxsm75dsNxj3u/V7dP/vTEiJmo/0SptpsstRiZ2 nNPuCVfZ461ule9m2/fw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r4NGF-008j9I-1x; Sat, 18 Nov 2023 15:29:31 +0000 Received: from dvalin.narfation.org ([2a00:17d8:100::8b1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r4NGC-008j8i-0p for openwrt-devel@lists.openwrt.org; Sat, 18 Nov 2023 15:29:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1700321366; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+/tjukM+f3Fu9BncZ9398Mit4nQIp8Q3/X3V8ZoOxkw=; b=Rkmt1n2ZkqoXr/pmh4W2IgMrD4TnJibJl/44xCRTw1/teehHfQ/l4ppKSm+S7Y6tQnIpCH ddAHqVUX+xbi/XPSzzAamAvdHnwsJd45zB2DhyWowi47VqhF3ZufPeaMJkgRQankjqv7g0 Rtd61yoqD3WrqNMLRnRmDWNCKYAMq3c= From: Sven Eckelmann <sven@narfation.org> Date: Sat, 18 Nov 2023 16:29:09 +0100 Subject: [PATCH v2] dnsmasq: mark global ubus context as closed after fork MIME-Version: 1.0 Message-Id: <20231118-dnsmasq_drop_ubus_null-v2-1-1e1f1f7ab251@narfation.org> X-B4-Tracking: v=1; b=H4sIAETYWGUC/x3M0QpAMBSA4VfRubay0cKrSGvs4BTDTpOSd7dcf hf//wBjIGRoswcCXsS0+wSVZzAu1s8oyCWDKlQppayF87xZPo0L+2HiENn4uK5CN1pLq2tXVgp SfASc6P7HXf++HwG6QH9oAAAA To: openwrt-devel@lists.openwrt.org Cc: Sven Eckelmann <sven@narfation.org> X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1530; i=sven@narfation.org; h=from:subject:message-id; bh=ZT2cyER1JZKsPP4z+0jCuWmk+Yy/sjlAlDPjYX0wFdE=; b=owEBbQKS/ZANAwAKAV2HCgfBJntGAcsmYgBlWNhKAzcytFEsj/xZr7qGCV+tkm9QlDZa9XPGK vFSNw0jnz+JAjMEAAEKAB0WIQQXXSuHYSVz3OMy4AJdhwoHwSZ7RgUCZVjYSgAKCRBdhwoHwSZ7 RrOiEACVKGytY78/7XqjDEBbV7dli6dj4VO9YC/TzcbmQ7/fZPR+qSI3Q8oWtJ8b6JcOaKx3J1Y B9GL0ImaD6p0mNJ1E1uURjQkpNu+XZLN1+bFtxT/vEZodC1cVfKMU4hLFi/3Lly2eO9Ya6cub+Y DrR5thGlneVx6rtC0Lni1QQPLHkuvSRBYh/jTJQLl6QKRlzHU7zBegd6jrIAs5RN8ye1p25V6aZ QpN76ZhiSQj2t5jqi0QYpmjJ4t8ykKkeMCaGL1TFz7ioo0C5+wf13P+WWkpK0K6B+0nLzOePmWF U59WWyFnm1Ze2mSgWifOHiVIKGjSLhdO5Hu7sRy2b3nITpQMvBBKUdN2sSnvjtANq4kh7A4YFHo BjcKVOv8OVL1s+dc9pIjC7fbgzqVk4+QHxCILPedugP3xAnooL3KnjWyiRojeBuisSWIkWzf8Vl gaY/Vur7goEY82qlQ/pYsRD6YYlN56CxauCk+BXG8auYKZopCTHGE6jducK7mU7+sdRTL4N1XPx wJnxwix2w3XQFyEnRWAypnqZ/6Krquo8RX2FTLkzDFVv4VG7lfw0Ql/W7Fry2co3K7n2AkUBkis lfQuAlfyGQhVR5llJfJhTqneUFm8zdN4Bj1b5PSU5srX/QZAZtEuVMqTZHhQ9TZEG2bcV7Qpw74 TFlQhR1QW383LPw== X-Developer-Key: i=sven@narfation.org; a=openpgp; fpr=522D7163831C73A635D12FE5EC371482956781AF X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231118_072928_460608_8C4CB8D0 X-CRM114-Status: GOOD ( 10.56 ) X-Spam-Score: -0.9 (/) 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 the dnsmasq process forks to handle TCP connections, it closes the ubus context. But instead of changing the daemon wide pointer to NULL, only the local variable was adjusted - and this portion of [...] Content analysis details: (-0.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [2a00:17d8:100:0:0:0:0:8b1 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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 |
[v2] dnsmasq: mark global ubus context as closed after fork
|
expand
|
diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch index 8a70bb8bdf..ccbe70ab9c 100644 --- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch +++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch @@ -210,7 +210,7 @@ + return; + + ubus_free(ubus); -+ ubus = NULL; ++ daemon->ubus = NULL; +} + static int ubus_handle_metrics(struct ubus_context *ctx, struct ubus_object *obj,
If the dnsmasq process forks to handle TCP connections, it closes the ubus context. But instead of changing the daemon wide pointer to NULL, only the local variable was adjusted - and this portion of the code was even dropped (dead store) by some optimizing compilers. It makes more sense to change the daemon->ubus pointer because various functions are already checking it for NULL. It is also the behavior which ubus_destroy() implements. Fixes: d8b33dad0bb7 ("dnsmasq: add support for monitoring and modifying dns lookup results via ubus") Signed-off-by: Sven Eckelmann <sven@narfation.org> --- Changes in v2: - added missing word "checking" in commit message. Thanks Eric <evil.function@proton.me> --- package/network/services/dnsmasq/patches/200-ubus_dns.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: 9062e5faaedc03823ee419fe34de1de73f48babc change-id: 20231118-dnsmasq_drop_ubus_null-69661a68d342 Best regards,