Message ID | 20201115091917.7798-1-wojciech.jowsa@gmail.com |
---|---|
State | Accepted |
Delegated to: | Daniel Golle |
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: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.openwrt.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=IIMLAGg3; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hDthSKjB; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (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 ozlabs.org (Postfix) with ESMTPS id 4CYmty3kcJz9sT6 for <incoming@patchwork.ozlabs.org>; Sun, 15 Nov 2020 20:22:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=R38b1pDXekyONaZav1ZsVb4C9OwKjZKHp/c4J/pfJAM=; b=IIMLAGg3yrwvrhljNvA4ROApu3 jHVwQcDdmoxGTkAFvtUX/bHC75p633m6+oXGsvtCbqZB3qBlpFgxT53HBUbcjSOO5xVDnr9ClgYoT Ghv0WH40swCf1XawYHmdzILgo6XWQasF8PM7noylBQHK51AEQoWsQJoDho1X1opSpFsjhpdMUht9g Qs1X8e6SarkROWDfAocWOJ2pBq3Inhlh4DhSfy+yYyI/+ITazhU69Qx4VhOZn2IPjubXEN6dD+QRE oZGr5rlI0SVfEC3DQ1yuapCdpv9Df2mWDQUxQz4psOYez1SESe2NWBBHSweUvh3PVF6rxvrpMSIbb 82tAVZEA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1keECc-00035e-E4; Sun, 15 Nov 2020 09:20:06 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1keECY-000353-OR for openwrt-devel@lists.openwrt.org; Sun, 15 Nov 2020 09:20:03 +0000 Received: by mail-lf1-x142.google.com with SMTP id j205so20388662lfj.6 for <openwrt-devel@lists.openwrt.org>; Sun, 15 Nov 2020 01:20:00 -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:mime-version :content-transfer-encoding; bh=38Jjzy83D5NQoK3LPwuTV6RFJJeD1tym6YKt8GQE/hc=; b=hDthSKjBWPuiU0lNLStte3QYDZZK0Js+aFQxySVruLz3zFMg9xxwhjzYbQ7rInUSLV U10Xyf92tw/P2VWtnofZCNmYATneWy4RF8Ue+nAllGvvIaG9CwaogTM61c4AMkhdVoKD /VS0S8QpRsqu32y/skA6BZHuy5VpCo7t08D/1QrHBljZVYlXC99marOrXvIU/IkN1Ieb c262QZrOJNE+QZbEHrHnYzrOIryxuLwRKU7lpMxFUE0TcxoUHAFIF93Yz+E8gTwhf9S8 giTbqUWgPpzvFAZqBUbaFnvAZzqXbqPOWlNH6XfHc5ZjMet/5itfWHBy9rtgtr8dAU3J Fe1g== 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:mime-version :content-transfer-encoding; bh=38Jjzy83D5NQoK3LPwuTV6RFJJeD1tym6YKt8GQE/hc=; b=qzKGdCIS/+N7eStivSa1PYj8u7zoQjFyPc/aBepPR63hhxda8INqDGaL9XTAQ1lArQ PnuZ6jpJ0y1BS2TZQYgwN0N32tWc1fO/4iewQlsFezgYQDn77seuZ50x9C/M4kfLWrMe sBKQzFUhxJ7W+eWa8305Jbd7X+t054jQQKgtZD6wbxP4CotXKJtQicbuif30pWasGYfy DCdmsERhAtnoRNVhWoQFV1cWJKjme6O7oI5mZgif1Ruo9KAJLCRSBTY3E6iLRfsXo1d6 xyYke+DO7NwLv0RT+4Mb07NrYQlsp/mcIHe5p4ssbRVSrKk+A+a/nj3pR5qL1ekgVUqB nCwA== X-Gm-Message-State: AOAM5324Xc5j1oBw8LeZEUSpWaoTdFBITnoOwVS2nuHyCEMunGiQfySk KS1MbpVnVAiFSYdimJiAymJzm4qyjL351w== X-Google-Smtp-Source: ABdhPJxNfU9lYh/sKDtyurJlECsxBLO2ioxvHFf8Q/6VCMqW7n5vt+YcfrCDLxZY2DgqTZEuGjC0yQ== X-Received: by 2002:a19:c005:: with SMTP id q5mr3435336lff.400.1605431999126; Sun, 15 Nov 2020 01:19:59 -0800 (PST) Received: from wjow-XPS-15-9570.lan (host-188-122-2-56.finemedia.pl. [188.122.2.56]) by smtp.gmail.com with ESMTPSA id s12sm2257225lfd.71.2020.11.15.01.19.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Nov 2020 01:19:58 -0800 (PST) From: Wojciech Jowsa <wojciech.jowsa@gmail.com> To: openwrt-devel@lists.openwrt.org Subject: [PATCH] ubus: fix uhttpd crash Date: Sun, 15 Nov 2020 10:19:17 +0100 Message-Id: <20201115091917.7798-1-wojciech.jowsa@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201115_042002_840146_B32C3099 X-CRM114-Status: GOOD ( 11.99 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:142 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wojciech.jowsa[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.29 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> Cc: Wojciech Jowsa <wojciech.jowsa@gmail.com> 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 |
ubus: fix uhttpd crash
|
expand
|
diff --git a/ubus.c b/ubus.c index cc7447e..619135c 100644 --- a/ubus.c +++ b/ubus.c @@ -357,6 +357,8 @@ static void uh_ubus_subscription_notification_remove_cb(struct ubus_context *ctx du = container_of(s, struct dispatch_ubus, sub); cl = container_of(du, struct client, dispatch.ubus); + ubus_unregister_subscriber(ctx, &du->sub); + ops->request_done(cl); }
Unregister ubus subscriber in notification remove callback. Without this call, uhttpd crashes when client tries to subscribe to the ubus object after the object was unregistred and registered again. It is bacuse the reference to ubus subscriber is not freed but the memory is cleared in the uh_request_done function. Signed-off-by: Wojciech Jowsa <wojciech.jowsa@gmail.com> --- ubus.c | 2 ++ 1 file changed, 2 insertions(+)