Bump buildroot to 2019.02
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
From cdc63fe259c70a8a5304aa07087650ebf4ee6b5d Mon Sep 17 00:00:00 2001
|
||||
From: Philippe Gerum <rpm@xenomai.org>
|
||||
Date: Wed, 24 Oct 2018 11:28:49 +0200
|
||||
Subject: [PATCH] demos/posix: prevent unterminated destination buffer with
|
||||
strncpy()
|
||||
|
||||
GCC 8.x introduced -Wstringop-truncation to help detecting likely
|
||||
unwanted outcomes of strncpy(dst, src, n), such as omitting the NUL
|
||||
character into the destination buffer whenever n < sizeof(src).
|
||||
|
||||
Fix unsafe strncpy() calls when we do expect a null-terminated
|
||||
destination buffer.
|
||||
|
||||
Signed-off-by: Philippe Gerum <rpm@xenomai.org>
|
||||
[Retrieved from
|
||||
https://gitlab.denx.de/Xenomai/xenomai/commit/cdc63fe259c70a8a5304aa07087650ebf4ee6b5d]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
demo/posix/cobalt/can-rtt.c | 4 ++--
|
||||
demo/posix/cobalt/eth_p_all.c | 3 ++-
|
||||
demo/posix/cyclictest/cyclictest.c | 4 ++--
|
||||
3 files changed, 6 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/demo/posix/cobalt/can-rtt.c b/demo/posix/cobalt/can-rtt.c
|
||||
index 61cad05e5..dd212d804 100644
|
||||
--- a/demo/posix/cobalt/can-rtt.c
|
||||
+++ b/demo/posix/cobalt/can-rtt.c
|
||||
@@ -248,7 +248,7 @@ int main(int argc, char *argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
- strncpy(ifr.ifr_name, rxdev, IFNAMSIZ);
|
||||
+ namecpy(ifr.ifr_name, rxdev);
|
||||
printf("RX rxsock=%d, ifr_name=%s\n", rxsock, ifr.ifr_name);
|
||||
|
||||
if (ioctl(rxsock, SIOCGIFINDEX, &ifr) < 0) {
|
||||
@@ -282,7 +282,7 @@ int main(int argc, char *argv[])
|
||||
goto failure1;
|
||||
}
|
||||
|
||||
- strncpy(ifr.ifr_name, txdev, IFNAMSIZ);
|
||||
+ namecpy(ifr.ifr_name, txdev);
|
||||
printf("TX txsock=%d, ifr_name=%s\n", txsock, ifr.ifr_name);
|
||||
|
||||
if (ioctl(txsock, SIOCGIFINDEX, &ifr) < 0) {
|
||||
diff --git a/demo/posix/cobalt/eth_p_all.c b/demo/posix/cobalt/eth_p_all.c
|
||||
index 6ac12ab3e..91aef9fbd 100644
|
||||
--- a/demo/posix/cobalt/eth_p_all.c
|
||||
+++ b/demo/posix/cobalt/eth_p_all.c
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <net/if.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/ether.h>
|
||||
+#include <boilerplate/ancillaries.h>
|
||||
|
||||
char buffer[10*1024];
|
||||
int sock;
|
||||
@@ -72,7 +73,7 @@ int main(int argc, char *argv[])
|
||||
if (argc > 1) {
|
||||
struct ifreq ifr;
|
||||
|
||||
- strncpy(ifr.ifr_name, argv[1], IFNAMSIZ);
|
||||
+ namecpy(ifr.ifr_name, argv[1]);
|
||||
if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) {
|
||||
perror("cannot get interface index");
|
||||
close(sock);
|
||||
diff --git a/demo/posix/cyclictest/cyclictest.c b/demo/posix/cyclictest/cyclictest.c
|
||||
index ebe5461db..76983bd02 100644
|
||||
--- a/demo/posix/cyclictest/cyclictest.c
|
||||
+++ b/demo/posix/cyclictest/cyclictest.c
|
||||
@@ -1353,7 +1353,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
case 'F':
|
||||
case OPT_FIFO:
|
||||
use_fifo = 1;
|
||||
- strncpy(fifopath, optarg, strlen(optarg));
|
||||
+ strncpy(fifopath, optarg, sizeof(fifopath) - 1);
|
||||
break;
|
||||
|
||||
case 'H':
|
||||
@@ -1458,7 +1458,7 @@ static void process_options (int argc, char *argv[], int max_cpus)
|
||||
case 'T':
|
||||
case OPT_TRACER:
|
||||
tracetype = CUSTOM;
|
||||
- strncpy(tracer, optarg, sizeof(tracer));
|
||||
+ strncpy(tracer, optarg, sizeof(tracer) - 1);
|
||||
break;
|
||||
case 'u':
|
||||
case OPT_UNBUFFERED:
|
||||
--
|
||||
2.18.1
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
config BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
|
||||
config BR2_PACKAGE_XENOMAI_COBALT_ARCH_SUPPORTS
|
||||
bool
|
||||
default y
|
||||
depends on BR2_i386 || BR2_x86_64 || (BR2_arm && !BR2_ARM_CPU_ARMV7M) || \
|
||||
BR2_bfin || BR2_powerpc
|
||||
BR2_powerpc
|
||||
|
||||
comment "xenomai needs an glibc or uClibc toolchain w/ threads"
|
||||
comment "xenomai needs a glibc or uClibc toolchain w/ threads"
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_TOOLCHAIN_USES_MUSL
|
||||
depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
|
||||
|
||||
config BR2_PACKAGE_XENOMAI
|
||||
bool "Xenomai Userspace"
|
||||
depends on BR2_PACKAGE_XENOMAI_ARCH_SUPPORTS
|
||||
depends on BR2_USE_MMU
|
||||
depends on BR2_TOOLCHAIN_HAS_SYNC_4
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
# uses <error.h>, __WORDSIZE and bits/local_lim.h
|
||||
depends on !BR2_TOOLCHAIN_USES_MUSL
|
||||
@@ -67,6 +69,7 @@ config BR2_PACKAGE_XENOMAI_MERCURY
|
||||
|
||||
config BR2_PACKAGE_XENOMAI_COBALT
|
||||
bool "Cobalt"
|
||||
depends on BR2_PACKAGE_XENOMAI_COBALT_ARCH_SUPPORTS
|
||||
help
|
||||
Select Cobalt core (dual kernel) for the Xenomai
|
||||
userspace. Use this if you use a Xenomai-patched
|
||||
|
||||
@@ -24,9 +24,6 @@ XENOMAI_LICENSE_FILES = debian/copyright include/COPYING kernel/cobalt/COPYING \
|
||||
|
||||
XENOMAI_DEPENDENCIES = host-pkgconf
|
||||
|
||||
# 0002-boilerplate-build-obstack-support-conditionally.patch
|
||||
XENOMAI_AUTORECONF = YES
|
||||
|
||||
XENOMAI_INSTALL_STAGING = YES
|
||||
XENOMAI_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install-user
|
||||
XENOMAI_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-user
|
||||
|
||||
Reference in New Issue
Block a user