From patchwork Mon Oct 14 08:21:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 1176059 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MXFOrb+4"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46sBNr4Gqxz9sPc for ; Mon, 14 Oct 2019 19:21:48 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 252E5865A1; Mon, 14 Oct 2019 08:21:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pgJ5MqXwyqVd; Mon, 14 Oct 2019 08:21:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 2D1548660A; Mon, 14 Oct 2019 08:21:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 52BF01BF20F for ; Mon, 14 Oct 2019 08:21:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4F60F8660A for ; Mon, 14 Oct 2019 08:21:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id K3Ebacg6C5Un for ; Mon, 14 Oct 2019 08:21:44 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7A83F865A1 for ; Mon, 14 Oct 2019 08:21:44 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id e13so1449724pga.7 for ; Mon, 14 Oct 2019 01:21:44 -0700 (PDT) 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=f/2mQSsehDJkJGvwslioQ8NZAGvuieqhLhthHcOAoBM=; b=MXFOrb+4BSxoMGHPIdwa6q53Ak+gmJEZ06iDXj2wlVDLGwndZnjIMjVepXaqWihvYw 1j8Yg2Ap2zcJ1YpAQ9LCOI6NO/77wmq5J0HUNRWZ71d5oieLtK8xL06ravb0RtVR8kUR Az9M4nCp5f5EsKAVzJ4WFdYDZlSFafwUUJtjzVm/T6m3nPtWSvaY+85rdF+FCKyhAYgj KzYNFukfq1kiu2uL6KUQrr+2/3SBc2Wgh6B45COOaPPnG7AhzoHjbPDKjAkVdtB7bztd rxeN4123A1JaEw7PwDLeE1mLyqbsp14A8ruLKfEx1+yviUEun27nyyCT/wW/+VDMGUij JCJw== 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=f/2mQSsehDJkJGvwslioQ8NZAGvuieqhLhthHcOAoBM=; b=F49BcaMPtNe/rA41BooEUHuJWYTZqwE7spXKM610++UGovXQof0CU9i6LrJ5iRWx4b R8w7gm/PN6Z91UzT/hVEiiBbe3qaxkFWZeGpvABpJUf02Mq45jPnwCu+oIWwoc2hWgfY ZxgW5+STAmvlayFDJRI6xW4zY14x+0SQJiTf0aIq2dCtxAP/Yu85HDA/c4tpoTqj9gG9 hR5Y1rxRbu5SJ1juX7J+eGEwjLZKUF5YNMstcY8cy+XbvcBXr4G3qk0d9DoGN5zz3eO4 HGSTn9MZz7Ngzidb5z9T2Woo/zsUQMp5uiComCKL3nPxhLiYN+9iemOiNKX0ghK4+BOV xMYA== X-Gm-Message-State: APjAAAXldPW4Yy6ftjiOa9nvRmmQX1vSQqcuNcfm3LFj+HA81Bvf2ik2 a4pMac8aXRtCx7HISpBhyGS80lVN X-Google-Smtp-Source: APXvYqwvj3BXyk9KFxN50kd0OFd/x0TDfL5iuZ7s9a7oA7rKdxAEyU1i4XGpaCaMEs2GUdkFYlqoDQ== X-Received: by 2002:a63:10d:: with SMTP id 13mr32271160pgb.173.1571041303442; Mon, 14 Oct 2019 01:21:43 -0700 (PDT) Received: from chrisp-dl.atlnz.lc ([2001:df5:b000:22:a55d:b187:a55f:5936]) by smtp.gmail.com with ESMTPSA id i187sm8419322pfc.177.2019.10.14.01.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 01:21:42 -0700 (PDT) From: Chris Packham To: buildroot@buildroot.org Date: Mon, 14 Oct 2019 21:21:32 +1300 Message-Id: <20191014082132.11049-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/syslog-ng: bump version to 3.24.1 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Drop patch applied upstream. Signed-off-by: Chris Packham --- ...plicit-un-initialized-state-to-Windo.patch | 118 ------------------ package/syslog-ng/syslog-ng.conf | 2 +- package/syslog-ng/syslog-ng.hash | 2 +- package/syslog-ng/syslog-ng.mk | 2 +- 4 files changed, 3 insertions(+), 121 deletions(-) delete mode 100644 package/syslog-ng/0002-logsource-add-explicit-un-initialized-state-to-Windo.patch diff --git a/package/syslog-ng/0002-logsource-add-explicit-un-initialized-state-to-Windo.patch b/package/syslog-ng/0002-logsource-add-explicit-un-initialized-state-to-Windo.patch deleted file mode 100644 index 1ddf0be1fd..0000000000 --- a/package/syslog-ng/0002-logsource-add-explicit-un-initialized-state-to-Windo.patch +++ /dev/null @@ -1,118 +0,0 @@ -From e350607f27b78094fb72422faf5394384ae6193b Mon Sep 17 00:00:00 2001 -From: Laszlo Budai -Date: Thu, 29 Aug 2019 17:09:39 +0200 -Subject: [PATCH] logsource: add explicit (un)initialized state to - WindowSizeCounter - -Fixes: #2893 - -On 32 bit systems (or non-64 bit systems), syslog-ng could abort during -shutdown. - -What was the reason of the abort? -a) in `log_source_set_options` where we set the initial window size -conditionally, the condition was false thus the `full_window_size` -remained 0 -b) when `log_source_free` is called during shutdown, - * `_release_dynamic_window` called unconditionally and - * a dynamic_part is calculated as full_window_size(=0) - init_window_size(=default 100), - so dynamic_part = -100 - * window_size is decremented by dynamic_part(-100) and the - `window_size_counter_sub` asserts on old_value >= value, and this - assert failed, so syslog-ng aborted - -So the questions are -1) why we did not set initial window size? -2) why old_value was not greater than value? - -Answers: -1) the value we get from `window_size_counter_get` is the masked -value... on 64 bit systems this value is a 63 bits of `1` and it is compared to -a 32 bits of `1` but the 63 bits are truncated to 32 thanks to an explicit cast -And what if we are on a 32 bits system? -Well... the sizeof(gsize) is 4 , sizeof(gint) is also 4 on these -systems. This means that the `window_size_counter_get` returns 31 bits of -`-1`, and it is compared to 32 bits of `1` : they are obviously not -equals -> we won't set full_window_size - -2) old_value is a -1, which is masked, so the actual old value is 2^31-1, while new value is a --100, which is (2^32-100), so on a 32 bits system 31 bit negative value is -compared to a to 32 bits negative value... - -Proposed solution: - * add a initialized state to LogSource: this is checked/(set to TRUE) only in - `log_source_set_options`, and set to FALSE only in `log_source_init_instance` - -Signed-off-by: Laszlo Budai -[Retrieved from: -https://github.com/syslog-ng/syslog-ng/commit/e350607f27b78094fb72422faf5394384ae6193b] -Signed-off-by: Ricardo Martincoski ---- - lib/logsource.c | 23 +++++++++++++++++------ - lib/logsource.h | 1 + - 2 files changed, 18 insertions(+), 6 deletions(-) - -diff --git a/lib/logsource.c b/lib/logsource.c -index 3f38b66e8..67e1c1570 100644 ---- a/lib/logsource.c -+++ b/lib/logsource.c -@@ -633,7 +633,20 @@ log_source_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options - evt_tag_printf("msg", "%p", msg)); - - msg_set_context(NULL); -+} -+ -+static void -+_initialize_window(LogSource *self, gint init_window_size) -+{ -+ self->window_initialized = TRUE; -+ window_size_counter_set(&self->window_size, init_window_size); -+ self->full_window_size = init_window_size; -+} - -+static gboolean -+_is_window_initialized(LogSource *self) -+{ -+ return self->window_initialized; - } - - void -@@ -645,11 +658,9 @@ log_source_set_options(LogSource *self, LogSourceOptions *options, - * configuration and we received a SIGHUP. This means that opened - * connections will not have their window_size changed. */ - -- if ((gint)window_size_counter_get(&self->window_size, NULL) == -1) -- { -- window_size_counter_set(&self->window_size, options->init_window_size); -- self->full_window_size = options->init_window_size; -- } -+ if (!_is_window_initialized(self)) -+ _initialize_window(self, options->init_window_size); -+ - self->options = options; - if (self->stats_id) - g_free(self->stats_id); -@@ -679,7 +690,7 @@ log_source_init_instance(LogSource *self, GlobalConfig *cfg) - self->super.free_fn = log_source_free; - self->super.init = log_source_init; - self->super.deinit = log_source_deinit; -- window_size_counter_set(&self->window_size, (gsize)-1); -+ self->window_initialized = FALSE; - self->ack_tracker = NULL; - } - -diff --git a/lib/logsource.h b/lib/logsource.h -index 370842efc..75d492604 100644 ---- a/lib/logsource.h -+++ b/lib/logsource.h -@@ -71,6 +71,7 @@ struct _LogSource - gchar *stats_instance; - WindowSizeCounter window_size; - DynamicWindow dynamic_window; -+ gboolean window_initialized; - /* full_window_size = static + dynamic */ - gsize full_window_size; - atomic_gssize window_size_to_be_reclaimed; --- -2.17.1 - diff --git a/package/syslog-ng/syslog-ng.conf b/package/syslog-ng/syslog-ng.conf index 3490e4a0f7..e8b9f1fba4 100644 --- a/package/syslog-ng/syslog-ng.conf +++ b/package/syslog-ng/syslog-ng.conf @@ -1,4 +1,4 @@ -@version: 3.23 +@version: 3.24 source s_sys { file("/proc/kmsg" program_override("kernel")); diff --git a/package/syslog-ng/syslog-ng.hash b/package/syslog-ng/syslog-ng.hash index 5ace261569..62bc48a7af 100644 --- a/package/syslog-ng/syslog-ng.hash +++ b/package/syslog-ng/syslog-ng.hash @@ -1,5 +1,5 @@ # Locally computed -sha256 fb36cfc1982831f74143b77a924ee79714745b5e2b3ff59d086d09a77d0acd38 syslog-ng-3.23.1.tar.gz +sha256 d4d0a0357b452be96b69d6f741129275530d8f0451e35adc408ad5635059fa3d syslog-ng-3.24.1.tar.gz sha256 835219c8ca76156e6337236d1bcb8e617c0b1c2783b4a8bc478e18a86743d607 COPYING sha256 ce3324c9f22299cfc7c281e5a6ab40fbe9c2ea1a67cee87226cb8cd39db1e1d2 GPL.txt sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 LGPL.txt diff --git a/package/syslog-ng/syslog-ng.mk b/package/syslog-ng/syslog-ng.mk index c31e71daf0..fc44777d16 100644 --- a/package/syslog-ng/syslog-ng.mk +++ b/package/syslog-ng/syslog-ng.mk @@ -6,7 +6,7 @@ # When updating the version, please check at runtime if the version in # syslog-ng.conf header needs to be updated -SYSLOG_NG_VERSION = 3.23.1 +SYSLOG_NG_VERSION = 3.24.1 SYSLOG_NG_SITE = https://github.com/balabit/syslog-ng/releases/download/syslog-ng-$(SYSLOG_NG_VERSION) SYSLOG_NG_LICENSE = LGPL-2.1+ (syslog-ng core), GPL-2.0+ (modules) SYSLOG_NG_LICENSE_FILES = COPYING GPL.txt LGPL.txt