Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 825CCC71153 for ; Mon, 28 Aug 2023 22:32:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 0C2F360F48; Mon, 28 Aug 2023 22:32:27 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 0C2F360F48 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y7YFpDnq7E4E; Mon, 28 Aug 2023 22:32:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp3.osuosl.org (Postfix) with ESMTP id 279AD60E3C; Mon, 28 Aug 2023 22:32:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 279AD60E3C Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id AB4141BF4E3 for ; Mon, 28 Aug 2023 22:32:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 4F90D40156 for ; Mon, 28 Aug 2023 22:32:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4F90D40156 X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7DoFKUvo9o_n for ; Mon, 28 Aug 2023 22:32:22 +0000 (UTC) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp2.osuosl.org (Postfix) with ESMTPS id DBA3E4013D for ; Mon, 28 Aug 2023 22:32:21 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org DBA3E4013D Received: by mail.gandi.net (Postfix) with ESMTPA id DBE4320003; Mon, 28 Aug 2023 22:32:18 +0000 (UTC) To: buildroot@buildroot.org Date: Tue, 29 Aug 2023 00:32:14 +0200 Message-ID: <20230828223215.2428514-1-thomas.petazzoni@bootlin.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-GND-Sasl: thomas.petazzoni@bootlin.com X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1693261939; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=6pXOeGMioA8FFWZAvmYcym+4+kRYdsWXv0ZKvVRHoyo=; b=KjYTpfKFrW1VoozE1L7ON1ljJRkXxD3SLuhp6dTwAXokb7/vgXWIwSpNbhHgooGmxVE7U6 XbX7XKO2/LhsCPffiXfPeKGta9MNXhfS3ry6KRdfmMLtNd0seGGJnT0Tq/dK4kPwgdGOGB so5hK6ZZ8I4H3Xyi4cymauU0gyH4o95vsZEsnoeR3XWPN0ZZklBZa3ISdikMOmLmzQ0X/r PBU9MD0ie4G76d7pZblaEuU8dMycRJXUQPMsMskyEiPoKjcu+1VFszes4HkTpWiIoLGnJx Q+mu7JmIC+RIWUpEuNQtNUuPbEbpywDXNrq0biQA8EccAJt6zqUSMV+KO00pkw== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=gm1 header.b=KjYTpfKF Subject: [Buildroot] [PATCH] package/log4cxx: ignore CVE-2023-31038 X-BeenThere: buildroot@buildroot.org 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: , From: Thomas Petazzoni via buildroot Reply-To: Thomas Petazzoni Cc: Thomas Petazzoni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" CVE-2023-31038 affects log4cxx only if ODBC is supported. While CVE-2023-31038 has been fixed in newer versions of log4cxx, there is quite a huge gap to do a version bump, and the commit that fixes CVE-2023-31038 could not be identified. Therefore, we want to rely on the fact that our log4cxx package does not support ODBC: there is indeed no explicit dependency on our unixodbc package in log4cxx.mk. However, log4cxx automatically detects if ODBC is available and if it is, it uses it. So what we do in this commit is backport an upstream commit, which adds explicitly options to enable/disable ODBC and ESMTP support, and we use them to (1) always disable ODBC and (2) explicitly enable/disable ESMTP support. Thanks to ODBC being disabled, we're not affected by CVE-2023-31038. Of course, there is a potential regression for users who were relying on the implicit unixodbc dependency, but as we could not identify the commit fixing the CVE-2023-31038, this is the best we can do at the moment. Signed-off-by: Thomas Petazzoni --- .../0001-Make-ODBC-and-SMTP-opt-in-191.patch | 73 +++++++++++++++++++ package/log4cxx/log4cxx.mk | 9 ++- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 package/log4cxx/0001-Make-ODBC-and-SMTP-opt-in-191.patch diff --git a/package/log4cxx/0001-Make-ODBC-and-SMTP-opt-in-191.patch b/package/log4cxx/0001-Make-ODBC-and-SMTP-opt-in-191.patch new file mode 100644 index 0000000000..a116fcc491 --- /dev/null +++ b/package/log4cxx/0001-Make-ODBC-and-SMTP-opt-in-191.patch @@ -0,0 +1,73 @@ +From 4900c27cc284ba2f671ae92e6ffb4ab391f9507a Mon Sep 17 00:00:00 2001 +From: Robert Middleton +Date: Mon, 6 Feb 2023 20:39:02 -0500 +Subject: [PATCH] Make ODBC and SMTP opt-in (#191) + +See #189 + +Upstream: afeaab6d0f0107c77dfadcbe3708f170c48d5ed9 +Signed-off-by: Thomas Petazzoni +--- + src/main/include/CMakeLists.txt | 40 ++++++++++++++++++++++++--------- + 1 file changed, 30 insertions(+), 10 deletions(-) + +diff --git a/src/main/include/CMakeLists.txt b/src/main/include/CMakeLists.txt +index e31443fb..d6835293 100644 +--- a/src/main/include/CMakeLists.txt ++++ b/src/main/include/CMakeLists.txt +@@ -85,22 +85,42 @@ include(CheckIncludeFiles) + include(CheckIncludeFileCXX) + include(CheckLibraryExists) + +-if(WIN32) +- CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++option(LOG4CXX_ENABLE_ODBC "Support logging via ODBC" OFF) ++if(LOG4CXX_ENABLE_ODBC) ++ if(WIN32) ++ CHECK_INCLUDE_FILES(sqlext.h HAS_ODBC) ++ else() ++ include(FindPkgConfig) ++ ++ pkg_check_modules( odbc odbc ) ++ if(${odbc_FOUND}) ++ set(HAS_ODBC 1) ++ else() ++ set(HAS_ODBC 0) ++ endif(${odbc_FOUND}) ++ endif(WIN32) ++ ++ if(NOT ${HAS_ODBC}) ++ message(SEND_ERROR "ODBC not found but requested") ++ endif() + else() +- include(FindPkgConfig) +- +- pkg_check_modules( odbc QUIET odbc ) +- if(${odbc_FOUND}) +- set(HAS_ODBC 1) +- endif(${odbc_FOUND}) +-endif(WIN32) ++ set(HAS_ODBC 0) ++endif(LOG4CXX_ENABLE_ODBC) ++ ++option(LOG4CXX_ENABLE_ESMTP "Support logging via libesmtp" OFF) ++if(LOG4CXX_ENABLE_ESMTP) ++ CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP) ++ if(NOT HAS_LIBESMTP) ++ message(SEND_ERROR "SMTP support with libesmtp not found but requested") ++ endif() ++else() ++ set(HAS_LIBESMTP 0) ++endif(LOG4CXX_ENABLE_ESMTP) + + CHECK_INCLUDE_FILE_CXX(locale HAS_STD_LOCALE) + CHECK_FUNCTION_EXISTS(mbsrtowcs HAS_MBSRTOWCS) + CHECK_FUNCTION_EXISTS(wcstombs HAS_WCSTOMBS) + CHECK_FUNCTION_EXISTS(fwide HAS_FWIDE) +-CHECK_LIBRARY_EXISTS(esmtp smtp_create_session "" HAS_LIBESMTP) + CHECK_FUNCTION_EXISTS(syslog HAS_SYSLOG) + if(UNIX) + set(CMAKE_REQUIRED_LIBRARIES "pthread") +-- +2.41.0 + diff --git a/package/log4cxx/log4cxx.mk b/package/log4cxx/log4cxx.mk index a5569126d4..aee682529c 100644 --- a/package/log4cxx/log4cxx.mk +++ b/package/log4cxx/log4cxx.mk @@ -11,10 +11,14 @@ LOG4CXX_INSTALL_STAGING = YES LOG4CXX_LICENSE = Apache-2.0 LOG4CXX_LICENSE_FILES = LICENSE LOG4CXX_CPE_ID_VENDOR = apache +# We do not support ODBC functionality +LOG4CXX_IGNORE_CVES = CVE-2023-31038 +# Note: if you want to support odbc, make sure CVE-2023-31038 is fixed LOG4CXX_CONF_OPTS = \ -DAPR_CONFIG_EXECUTABLE=$(STAGING_DIR)/usr/bin/apr-1-config \ - -DAPR_UTIL_CONFIG_EXECUTABLE=$(STAGING_DIR)/usr/bin/apu-1-config + -DAPR_UTIL_CONFIG_EXECUTABLE=$(STAGING_DIR)/usr/bin/apu-1-config \ + -DLOG4CXX_ENABLE_ODBC=OFF LOG4CXX_DEPENDENCIES = apr apr-util @@ -23,7 +27,10 @@ LOG4CXX_DEPENDENCIES += boost endif ifeq ($(BR2_PACKAGE_LIBESMTP),y) +LOG4CXX_CONF_OPTS += -DLOG4CXX_ENABLE_LIBESMTP=ON LOG4CXX_DEPENDENCIES += libesmtp +else +LOG4CXX_CONF_OPTS += -DLOG4CXX_ENABLE_LIBESMTP=OFF endif ifeq ($(BR2_USE_WCHAR),y) -- 2.41.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot