added my Recipes
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
From b6149e203f919c899fefc702a17fbb78bdec3700 Mon Sep 17 00:00:00 2001
|
||||
From: Le Van Khanh <Khanh.LeVan@vn.bosch.com>
|
||||
Date: Thu, 9 Feb 2023 03:17:13 -0500
|
||||
Subject: [PATCH] Fix memory leak
|
||||
|
||||
Free the ecuid_conf in case of memory alllocated
|
||||
|
||||
CVE: CVE-2023-26257
|
||||
|
||||
Upstream-Status: Backport
|
||||
[https://github.com/COVESA/dlt-daemon/pull/441/commits/b6149e203f919c899fefc702a17fbb78bdec3700]
|
||||
|
||||
Signed-off-by: Le Van Khanh <Khanh.LeVan@vn.bosch.com>
|
||||
|
||||
Signed-off-by: Yogita Urade <yogita.urade@windriver.com>
|
||||
---
|
||||
src/console/dlt-control-common.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/console/dlt-control-common.c b/src/console/dlt-control-common.c
|
||||
index abcaf92..64951c1 100644
|
||||
--- a/src/console/dlt-control-common.c
|
||||
+++ b/src/console/dlt-control-common.c
|
||||
@@ -124,6 +124,8 @@ void set_ecuid(char *ecuid)
|
||||
if (dlt_parse_config_param("ECUId", &ecuid_conf) == 0) {
|
||||
memset(local_ecuid, 0, DLT_CTRL_ECUID_LEN);
|
||||
strncpy(local_ecuid, ecuid_conf, DLT_CTRL_ECUID_LEN);
|
||||
+ if (ecuid_conf !=NULL)
|
||||
+ free(ecuid_conf);
|
||||
local_ecuid[DLT_CTRL_ECUID_LEN - 1] = '\0';
|
||||
}
|
||||
else {
|
||||
--
|
||||
2.34.1
|
||||
@@ -0,0 +1,45 @@
|
||||
From dd2d42a7f877d292f86e421dd9651f4b7c2abf18 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Tue, 19 Apr 2022 14:57:58 -0700
|
||||
Subject: [PATCH] cmake: Link with libatomic on rv32/rv64
|
||||
|
||||
Use of <atomic> needs to link in libatomic on riscv
|
||||
Fixes
|
||||
|
||||
undefined reference to `__atomic_exchange_1'
|
||||
|
||||
Upstream-Status: Pending
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/lib/CMakeLists.txt | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
|
||||
index 3293376..65018be 100644
|
||||
--- a/src/lib/CMakeLists.txt
|
||||
+++ b/src/lib/CMakeLists.txt
|
||||
@@ -37,6 +37,12 @@ else()
|
||||
set(SOCKET_LIBRARY socket)
|
||||
endif()
|
||||
|
||||
+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv32")
|
||||
+ set(ATOMIC_LIBRARY atomic)
|
||||
+else()
|
||||
+ set(ATOMIC_LIBRARY "")
|
||||
+endif()
|
||||
+
|
||||
if(HAVE_FUNC_PTHREAD_SETNAME_NP)
|
||||
add_definitions(-DDLT_USE_PTHREAD_SETNAME_NP)
|
||||
message(STATUS "Using pthread_setname_np API to set thread name")
|
||||
@@ -44,7 +50,7 @@ else()
|
||||
message(STATUS "pthread_setname_np API not available on this platform")
|
||||
endif()
|
||||
|
||||
-target_link_libraries(dlt ${RT_LIBRARY} ${SOCKET_LIBRARY} Threads::Threads)
|
||||
+target_link_libraries(dlt ${RT_LIBRARY} ${SOCKET_LIBRARY} ${ATOMIC_LIBRARY} Threads::Threads)
|
||||
|
||||
target_include_directories(dlt
|
||||
PUBLIC
|
||||
--
|
||||
2.36.0
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 94378458d653b1edca86435026909592cbe5e793 Mon Sep 17 00:00:00 2001
|
||||
From: Changqing Li <changqing.li@windriver.com>
|
||||
Date: Fri, 19 Aug 2022 11:12:17 +0800
|
||||
Subject: [PATCH] dlt-system: Fix buffer overflow detection on 32bit targets
|
||||
|
||||
On 32bit target, dlt-system will termiated with error:
|
||||
dlt-system: *** buffer overflow detected ***: terminated
|
||||
|
||||
Upstream-Status: Submitted [https://github.com/COVESA/dlt-daemon/pull/398]
|
||||
|
||||
Signed-off-by: Changqing Li <changqing.li@windriver.com>
|
||||
---
|
||||
src/system/dlt-system-watchdog.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/system/dlt-system-watchdog.c b/src/system/dlt-system-watchdog.c
|
||||
index a2b01de..c0eaa12 100644
|
||||
--- a/src/system/dlt-system-watchdog.c
|
||||
+++ b/src/system/dlt-system-watchdog.c
|
||||
@@ -109,8 +109,8 @@ int register_watchdog_fd(struct pollfd *pollfd, int fdcnt)
|
||||
|
||||
void watchdog_fd_handler(int fd)
|
||||
{
|
||||
- long int timersElapsed = 0;
|
||||
- int r = read(fd, &timersElapsed, 8); // only needed to reset fd event
|
||||
+ uint64_t timersElapsed = 0ULL;
|
||||
+ int r = read(fd, &timersElapsed, 8U); // only needed to reset fd event
|
||||
if(r < 0)
|
||||
DLT_LOG(watchdogContext, DLT_LOG_ERROR, DLT_STRING("Could not reset systemd watchdog. Exit with: "),
|
||||
DLT_STRING(strerror(r)));
|
||||
@@ -120,4 +120,4 @@ void watchdog_fd_handler(int fd)
|
||||
|
||||
DLT_LOG(watchdogContext, DLT_LOG_DEBUG, DLT_STRING("systemd watchdog waited periodic\n"));
|
||||
}
|
||||
-#endif
|
||||
\ No newline at end of file
|
||||
+#endif
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
From bcca4c99394ba422d03a5e76f2a0023ef248824a Mon Sep 17 00:00:00 2001
|
||||
From: Andrei Gherzan <andrei.gherzan@windriver.com>
|
||||
Date: Tue, 18 Nov 2014 15:47:22 +0100
|
||||
Subject: [PATCH 2/4] Don't execute processes as a specific user.
|
||||
|
||||
Upstream-Status: Inappropriate [Configuration Specific]
|
||||
Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
|
||||
---
|
||||
systemd/dlt-adaptor-udp.service.cmake | 1 -
|
||||
systemd/dlt-dbus.service.cmake | 1 -
|
||||
systemd/dlt-example-user.service.cmake | 1 -
|
||||
systemd/dlt-receive.service.cmake | 1 -
|
||||
systemd/dlt-system.service.cmake | 1 -
|
||||
systemd/dlt.service.cmake | 1 -
|
||||
6 files changed, 6 deletions(-)
|
||||
|
||||
diff --git a/systemd/dlt-adaptor-udp.service.cmake b/systemd/dlt-adaptor-udp.service.cmake
|
||||
index 8dac1f2..ecf9f9e 100644
|
||||
--- a/systemd/dlt-adaptor-udp.service.cmake
|
||||
+++ b/systemd/dlt-adaptor-udp.service.cmake
|
||||
@@ -21,9 +21,8 @@ Wants=dlt.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
-User=@DLT_USER@
|
||||
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-adaptor-udp -a @DLT_ADAPTOR_UDP_APPID@ -c @DLT_ADAPTOR_UDP_CTID@ -p @DLT_ADAPTOR_UDP_PORT@
|
||||
LimitCORE=infinity
|
||||
|
||||
[Install]
|
||||
-WantedBy=multi-user.target
|
||||
\ No newline at end of file
|
||||
+WantedBy=multi-user.target
|
||||
diff --git a/systemd/dlt-dbus.service.cmake b/systemd/dlt-dbus.service.cmake
|
||||
index 9baf3e9..74a7eac 100644
|
||||
--- a/systemd/dlt-dbus.service.cmake
|
||||
+++ b/systemd/dlt-dbus.service.cmake
|
||||
@@ -20,7 +20,6 @@ Wants=dlt.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
-User=@DLT_USER@
|
||||
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-dbus
|
||||
WatchdogSec=@DLT_WatchdogSec@
|
||||
NotifyAccess=main
|
||||
diff --git a/systemd/dlt-example-user.service.cmake b/systemd/dlt-example-user.service.cmake
|
||||
index b665742..35009b0 100644
|
||||
--- a/systemd/dlt-example-user.service.cmake
|
||||
+++ b/systemd/dlt-example-user.service.cmake
|
||||
@@ -21,6 +21,5 @@ Wants=dlt.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
-User=@DLT_USER@
|
||||
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-example-user "Hallo from GENIVI DLT example user application"
|
||||
-LimitCORE=infinity
|
||||
\ No newline at end of file
|
||||
+LimitCORE=infinity
|
||||
diff --git a/systemd/dlt-receive.service.cmake b/systemd/dlt-receive.service.cmake
|
||||
index c07d447..8f88f00 100644
|
||||
--- a/systemd/dlt-receive.service.cmake
|
||||
+++ b/systemd/dlt-receive.service.cmake
|
||||
@@ -22,6 +22,5 @@ Wants=dlt.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
-User=@DLT_USER@
|
||||
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-receive -o /tmp/dlt_receive_log.dlt localhost
|
||||
-LimitCORE=infinity
|
||||
\ No newline at end of file
|
||||
+LimitCORE=infinity
|
||||
diff --git a/systemd/dlt-system.service.cmake b/systemd/dlt-system.service.cmake
|
||||
index 0e91f42..1a5b913 100755
|
||||
--- a/systemd/dlt-system.service.cmake
|
||||
+++ b/systemd/dlt-system.service.cmake
|
||||
@@ -22,7 +22,6 @@ Wants=dlt.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
-User=@DLT_USER@
|
||||
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-system
|
||||
WatchdogSec=@DLT_WatchdogSec@
|
||||
NotifyAccess=main
|
||||
diff --git a/systemd/dlt.service.cmake b/systemd/dlt.service.cmake
|
||||
index 0b3ee2c..e4753a2 100755
|
||||
--- a/systemd/dlt.service.cmake
|
||||
+++ b/systemd/dlt.service.cmake
|
||||
@@ -21,7 +21,6 @@ Documentation=man:dlt-daemon(1) man:dlt.conf(5)
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
-User=@DLT_USER@
|
||||
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/dlt-daemon
|
||||
WatchdogSec=@DLT_WatchdogSec@
|
||||
NotifyAccess=main
|
||||
@@ -0,0 +1,24 @@
|
||||
From 9a5e655cf57301008cd61d53c8a410a7f397e650 Mon Sep 17 00:00:00 2001
|
||||
From: Andrei Gherzan <andrei.gherzan@windriver.com>
|
||||
Date: Tue, 18 Nov 2014 15:51:30 +0100
|
||||
Subject: [PATCH 4/4] Modify systemd config directory
|
||||
|
||||
Upstream-Status: Inappropriate [Configuration Specific]
|
||||
Signed-off-by: Andrei Gherzan <andrei.gherzan@windriver.com>
|
||||
---
|
||||
systemd/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index e6b44a2..0e885bf 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -201,7 +201,7 @@ if(WITH_SYSTEMD OR WITH_SYSTEMD_WATCHDOG OR WITH_SYSTEMD_JOURNAL)
|
||||
|
||||
set(systemd_SRCS ${PROJECT_SOURCE_DIR}/systemd/3rdparty/sd-daemon.c)
|
||||
|
||||
- set(SYSTEMD_UNITDIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system" CACHE PATH
|
||||
+ set(SYSTEMD_UNITDIR "/lib/systemd/system" CACHE PATH
|
||||
"Set directory to install systemd unit files")
|
||||
|
||||
add_subdirectory(systemd)
|
||||
@@ -0,0 +1,74 @@
|
||||
SUMMARY = "Diagnostic Log and Trace"
|
||||
DESCRIPTION = "This component provides a standardised log and trace interface, \
|
||||
based on the standardised protocol specified in the AUTOSAR standard 4.0 DLT. \
|
||||
This component can be used by GENIVI components and other applications as \
|
||||
logging facility providing: \
|
||||
- the DLT shared library \
|
||||
- the DLT daemon, including startup scripts \
|
||||
- the DLT daemon adaptors- the DLT client console utilities \
|
||||
- the DLT test applications"
|
||||
HOMEPAGE = "https://www.genivi.org/"
|
||||
SECTION = "console/utils"
|
||||
LICENSE = "MPL-2.0"
|
||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=8184208060df880fe3137b93eb88aeea"
|
||||
|
||||
DEPENDS = "zlib gzip-native json-c"
|
||||
|
||||
SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=https;branch=master \
|
||||
file://0002-Don-t-execute-processes-as-a-specific-user.patch \
|
||||
file://0004-Modify-systemd-config-directory.patch \
|
||||
file://0001-cmake-Link-with-libatomic-on-rv32-rv64.patch \
|
||||
file://0001-dlt-system-Fix-buffer-overflow-detection-on-32bit-ta.patch \
|
||||
file://0001-Fix-memory-leak.patch \
|
||||
"
|
||||
SRCREV = "6a3bd901d825c7206797e36ea98e10a218f5aad2"
|
||||
|
||||
PV .= "+2.18.9git${SRCPV}"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
LDFLAGS:append:riscv64 = " -latomic"
|
||||
|
||||
PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd systemd-watchdog systemd-journal dlt-examples dlt-adaptor dlt-adaptor-udp dlt-console ', '', d)} \
|
||||
udp-connection dlt-system dlt-filetransfer "
|
||||
# dlt-dbus
|
||||
|
||||
# General options
|
||||
PACKAGECONFIG[dlt-examples] = "-DWITH_DLT_EXAMPLES=ON,-DWITH_DLT_EXAMPLES=OFF,,dlt-daemon-systemd"
|
||||
|
||||
# Linux options
|
||||
PACKAGECONFIG[systemd] = "-DWITH_SYSTEMD=ON,-DWITH_SYSTEMD=OFF -DWITH_DLT_SYSTEM=OFF,systemd"
|
||||
PACKAGECONFIG[systemd-watchdog] = "-DWITH_SYSTEMD_WATCHDOG=ON,-DWITH_SYSTEMD_WATCHDOG=OFF,systemd,libsystemd"
|
||||
PACKAGECONFIG[systemd-journal] = "-DWITH_SYSTEMD_JOURNAL=ON,-DWITH_SYSTEMD_JOURNAL=OFF,systemd,libsystemd"
|
||||
PACKAGECONFIG[dlt-dbus] = "-DWITH_DLT_DBUS=ON,-DWITH_DLT_DBUS=OFF,dbus,dbus-lib"
|
||||
PACKAGECONFIG[udp-connection] = "-DWITH_UDP_CONNECTION=ON,-DWITH_UDP_CONNECTION=OFF"
|
||||
|
||||
# Command line options
|
||||
PACKAGECONFIG[dlt-system] = "-DWITH_DLT_SYSTEM=ON,-DWITH_DLT_SYSTEM=OFF"
|
||||
PACKAGECONFIG[dlt-adaptor] = "-DWITH_DLT_ADAPTOR=ON,-DWITH_DLT_ADAPTOR=OFF,,dlt-daemon-systemd"
|
||||
PACKAGECONFIG[dlt-adaptor-udp] = "-DWITH_DLT_ADAPTOR_UDP=ON,-DWITH_DLT_ADAPTOR_UDP=OFF,,dlt-daemon-systemd"
|
||||
PACKAGECONFIG[dlt-filetransfer] = "-DWITH_DLT_FILETRANSFER=ON,-DWITH_DLT_FILETRANSFER=OFF"
|
||||
PACKAGECONFIG[dlt-console] = "-DWITH_DLT_CONSOLE=ON,-DWITH_DLT_CONSOLE=OFF,,dlt-daemon-systemd"
|
||||
|
||||
inherit autotools gettext cmake pkgconfig systemd
|
||||
|
||||
EXTRA_OECMAKE += "-DWITH_EXTENDED_FILTERING=ON -DSYSTEMD_UNITDIR=${systemd_system_unitdir}"
|
||||
|
||||
PACKAGES += "${PN}-systemd"
|
||||
SYSTEMD_PACKAGES = "${PN} ${PN}-systemd"
|
||||
SYSTEMD_SERVICE:${PN} = " ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'dlt.service', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'dlt-system', 'dlt-system.service', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'dlt-dbus', 'dlt-dbus.service', '', d)}"
|
||||
SYSTEMD_AUTO_ENABLE:${PN} = "enable"
|
||||
SYSTEMD_SERVICE:${PN}-systemd = " \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'dlt-adaptor-udp', 'dlt-adaptor-udp.service', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'dlt-examples', 'dlt-example-user.service', '', d)} \
|
||||
${@bb.utils.contains('PACKAGECONFIG', 'dlt-examples dlt-console', 'dlt-receive.service', '', d)} \
|
||||
"
|
||||
SYSTEMD_AUTO_ENABLE:${PN}-systemd = "disable"
|
||||
|
||||
FILES:${PN}-doc += "${datadir}/dlt-filetransfer"
|
||||
|
||||
do_install:append() {
|
||||
rm -f ${D}${bindir}/dlt-test-*
|
||||
}
|
||||
Reference in New Issue
Block a user