From patchwork Wed Dec 25 16:54:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 182444 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp770267ild; Wed, 25 Dec 2019 08:54:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxmsJFHK6zAOk0SuPVOsdpLVR7B+77PLXEqubhWF5OcngC6PQtIwxee10SzLYQz+Cu13Zw8 X-Received: by 2002:a17:902:aa46:: with SMTP id c6mr42867313plr.200.1577292895763; Wed, 25 Dec 2019 08:54:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577292895; cv=none; d=google.com; s=arc-20160816; b=tmkzr1+zpbLWTrQCyRn+jh8xRKwZvAblg+lW8ZJfLKAkbP5ngUKujZqlXWirGX2xNP HiW3jRWMBsJ4zf/HGmGN8C+B1gnkj92defYzhE7yJBIs1UcdQmwJkWk4kBdERbAqgA5k KuWXE0dW3YA4ocPktCjOnfJmmI66mJx77KqqRL3aJyTv759eh/WEueuLb/VXAUZX82do lA488jL+ns21mkpkFpI1zZhJAGs6B5AmsvrJJu88n/ENCNxu9dC8Fcf8y24brbecsVrt huR3QejYbKEtG8GflnhWg4DQajmaA+5m5h+rOx+uYAJuimem1+CngxkHpfLxQzh5j6fD MbaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=u+2cUyEK45elmOGdt/Im+/sfcxTW8Iop2mQryTOWD74=; b=wLqsG5DlrklyzUUALltKaY4TlD5Ej1+yRd6hReFnq9Jd7VVl3+tcIQ8B5IlYehywvK M/rAuXUEz9tvNEnZrp8NZQ7efg2N8zeUef+reuAl4Hhc5G5DW06X5UULPoSN3hPZTrTf l0VhqJrlKDrDzlS6hTmZ0UKEYvFCdwd1Ucpkt3OA5bCkuL4FItfZfCnAHDkWJQzDCyFe 90H4yXIewRymwYUuOAOiWUcuVvdnqjkoRajMENnBAjHOCuMVIQ/EusHPolpdQnFXt3n3 bm1QAQY2Uhr2FVP7EG16jVhagDXKJseN4Ro0oJJhYUPruC+QJV3G9ieFowEcKr5lxHTA spWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="iC3Yw/s1"; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id w67si22809294pfd.176.2019.12.25.08.54.54; Wed, 25 Dec 2019 08:54:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="iC3Yw/s1"; spf=pass (google.com: best guess record for domain of openembedded-devel-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-devel-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id CD2C57D537; Wed, 25 Dec 2019 16:54:45 +0000 (UTC) X-Original-To: openembedded-devel@lists.openembedded.org Delivered-To: openembedded-devel@lists.openembedded.org Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by mail.openembedded.org (Postfix) with ESMTP id 8CE7F7C7A9 for ; Wed, 25 Dec 2019 16:54:42 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id l35so2482713pje.3 for ; Wed, 25 Dec 2019 08:54:43 -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=doNv+YS5AA7UYHRunwK9T1x0qODELLAwhYrfAnZT9a0=; b=iC3Yw/s1ycLYag7EkoWXuRvWsh5LoIX3CLe5Hoae0wVYV/uoNb6gzOEFkLx+yyG1RG maeWbGFrLNt7RjYrgzIxs3NbQDcFfucT1B2tHhx/hrxNN/gIZFMBwI81pWoeixdltX7F Ky2Gct7D1dDJt0IOIfV+0yVW3w3bT5wCvjnm4LPRdeOf10+T/cBMi5FsDNQMC7tbCuh9 kMwbgJcfdK0xYCpb1PvLCPuBw32dAGY9tCbvVM5HtUaS1gF+O4XdMeOGMDRz3wx7vk9T pNeoE7C7r9qOLE1nH8rRx8j5jZ3gdAmtKXAFZ/MWHJNCAwsI44occjpMWmq8fFPDRttF VfOg== 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=doNv+YS5AA7UYHRunwK9T1x0qODELLAwhYrfAnZT9a0=; b=gH0XOVIEX5BiZxIaX/Tb27uJWd1sosZHoeTiM9NhLxKFnV+lo/5QZDvyrp1Zo74RmF 4XU/RZaI7ZmU2RH6ZhuXa/sM0x1GLWd+/dTFga1qp3hOK4WeV7OJCTOfumo4lhQ+GXAV PJQ8JWbEj/TZGHVRzt31E7niYGnt7qXLq+kdz84JLVKGUf4hRA++1cCdaE47efQPyNlC +QgUfg3R7BJEpNI5lvxRyc/IHXBqRjn5BULWCJVIi/DktgkfJa1nifZ0eccmbPQ3NREH /NytVPat9JZm0vmCtOTIjxOXIys0MLjFkkETDRNmz61UXGT+28+sn5L4NghvWdDoHUZO U9xw== X-Gm-Message-State: APjAAAUW45Ji2is4yVrXljN8Oh2B8fx6v4/Aa0K11HhS0D9TbsTsZ3Dq WAoo27NgfnWHs6jq8l/WRLQoEEMsud0= X-Received: by 2002:a17:90a:ac18:: with SMTP id o24mr14087529pjq.33.1577292882900; Wed, 25 Dec 2019 08:54:42 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:4e0::36e9]) by smtp.gmail.com with ESMTPSA id y38sm29859982pgk.33.2019.12.25.08.54.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Dec 2019 08:54:42 -0800 (PST) From: Khem Raj To: openembedded-devel@lists.openembedded.org Date: Wed, 25 Dec 2019 08:54:35 -0800 Message-Id: <20191225165435.2122812-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Subject: [oe] [meta-oe][PATCH] libubox: Update to latest X-BeenThere: openembedded-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Using the OpenEmbedded metadata to build Distributions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-devel-bounces@lists.openembedded.org Errors-To: openembedded-devel-bounces@lists.openembedded.org Fix out of bounds array access Signed-off-by: Khem Raj --- ...x-array-out-of-bounds-GCC-10-warning.patch | 42 +++++++++++++++++++ .../recipes-devtools/libubox/libubox_git.bb | 3 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch diff --git a/meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch b/meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch new file mode 100644 index 0000000000..4f1dd76326 --- /dev/null +++ b/meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch @@ -0,0 +1,42 @@ +From a12325a0cbf3bf1d66a0b0f8d85e08083bae6066 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Wed, 25 Dec 2019 10:27:59 +0100 +Subject: [PATCH] blobmsg: fix array out of bounds GCC 10 warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes following warning reported by GCC 10.0.0 20191203: + + blobmsg.c:234:2: error: 'strcpy' offset 6 from the object at 'attr' is out of the bounds of referenced subobject 'name' with type 'uint8_t[0]' {aka 'unsigned char[0]'} at offset 6 [-Werror=array-bounds] + 234 | strcpy((char *) hdr->name, (const char *)name); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + In file included from blobmsg.c:16: + blobmsg.h:42:10: note: subobject 'name' declared here + 42 | uint8_t name[]; + | ^~~~ + +Upstream-Status: Submitted [https://gitlab.com/ynezz/openwrt-libubox/commit/3775b3aa28de8c20d96b6f02786a327423b0748a] +Reported-by: Khem Raj +Signed-off-by: Petr Štetiar +--- + blobmsg.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/blobmsg.c b/blobmsg.c +index a860483..b6b7535 100644 +--- a/blobmsg.c ++++ b/blobmsg.c +@@ -195,7 +195,7 @@ blobmsg_new(struct blob_buf *buf, int type, const char *name, int payload_len, v + attr->id_len |= be32_to_cpu(BLOB_ATTR_EXTENDED); + hdr = blob_data(attr); + hdr->namelen = cpu_to_be16(namelen); +- strcpy((char *) hdr->name, (const char *)name); ++ memcpy(hdr->name, name, namelen); + pad_end = *data = blobmsg_data(attr); + pad_start = (char *) &hdr->name[namelen]; + if (pad_start < pad_end) +-- +2.24.1 + diff --git a/meta-oe/recipes-devtools/libubox/libubox_git.bb b/meta-oe/recipes-devtools/libubox/libubox_git.bb index f9f4e08b71..7dbefa1152 100644 --- a/meta-oe/recipes-devtools/libubox/libubox_git.bb +++ b/meta-oe/recipes-devtools/libubox/libubox_git.bb @@ -16,9 +16,10 @@ SRC_URI = "\ git://git.openwrt.org/project/libubox.git \ file://0001-version-libraries.patch \ file://fix-libdir.patch \ + file://0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch \ " -SRCREV = "155bf39896f126b1ba121b816922a88dc34c31e3" +SRCREV = "07413cce72e19520af55dfcbc765484f5ab41dd9" PV = "1.0.1+git${SRCPV}" S = "${WORKDIR}/git"