package/mmc-utils: add patch to fix build failure
PATCH 1/1 package/mmc-utils: add patch to fix build failure
Patch taken from:
- https://patchwork.kernel.org/patch/10654531/
Fixes:
- http://autobuild.buildroot.net/results/404bfbd095a7b80273391ea36ea81ba496164b80
- http://autobuild.buildroot.net/results/233ef5c00951b5be10a59408f4a8781ecc658d74
- http://autobuild.buildroot.net/results/eba3cf4ac21095bca5af2d5d1d69aca0c9098f9b
--- .../0002-fix-overlapping-with-strncpy.patch | 125 +++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 package/mmc-utils/0002-fix-overlapping-with-strncpy.patch
package/mmc-utils/0002-fix-overlapping-with-strncpy.patch new file +125 -0
@@ -0,0 +1,125 @@ +From patchwork Wed Oct 24 11:00:47 2018 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= <[email protected]> +X-Patchwork-Id: 10654531 +Return-Path: <[email protected]> +Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org + [172.30.200.125]) + by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3105E14BD + for <[email protected]>; + Wed, 24 Oct 2018 11:00:59 +0000 (UTC) +Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) + by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20E0A2A51C + for <[email protected]>; + Wed, 24 Oct 2018 11:00:59 +0000 (UTC) +Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) + id 14AF62A5E2; Wed, 24 Oct 2018 11:00:59 +0000 (UTC) +X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on + pdx-wl-mail.web.codeaurora.org +X-Spam-Level: +X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, + DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI + autolearn=ham version=3.3.1 +Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) + by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC7952A51C + for <[email protected]>; + Wed, 24 Oct 2018 11:00:58 +0000 (UTC) +Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand + id S1727314AbeJXT2g (ORCPT + <rfc822;[email protected]>); + Wed, 24 Oct 2018 15:28:36 -0400 +Received: from mail-wr1-f65.google.com ([209.85.221.65]:41460 "EHLO + mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org + with ESMTP id S1727204AbeJXT2g (ORCPT + <rfc822;[email protected]>); Wed, 24 Oct 2018 15:28:36 -0400 +Received: by mail-wr1-f65.google.com with SMTP id q7-v6so5080352wrr.8 + for <[email protected]>; Wed, 24 Oct 2018 04:00:57 -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=tIHlGPgDyddBEWtmgSHVqn9+naMOOYLC+w0Xgy/DFc8=; + b=JnK9VJyDWrgdSikj+IF1zNn4ymwLnrTvovJTNoeSuc/WbXaPaehINB+NESfO8RoI/Q + DrGoLeU+24j9ONhrVcv0uurLfzezK/Cla0MV5+KUO22oAmvKxxuoyqw6g7OOX+S1G8/+ + PRTgUQaczdBdGIL3NdABPiKiwZimC5L/26M0Shzo73MJqsQgUwShSV8pCMjDmi9ba6Ai + 6sc/bYy+1Rdbn/IPJ3qdrAsL8i/wM5yr0Ql7lABXuhm3B+4CI25nOZmYDJ+ffxnoJdmI + n+GU2Lc0H6z6sfpKluNE8z6b5Mgyj1sCyn3eX6iJhpbcyxlufUhot3/ghTlr72QLY1N5 + r1uQ== +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=tIHlGPgDyddBEWtmgSHVqn9+naMOOYLC+w0Xgy/DFc8=; + b=fs28QqB53ZKBjalAdVPPocynqDU+plxyQ9fsmG47SLtXf8Vd6xzTg0fRm0/IEnSfjA + vZokBEVwxYsHdvFsaokzhQogXGtBdYA/VG1p1rPA6cFN77N+3PD1id+N5+kDkm13NSvV + oyVPBhjom2/sUF0ThgBRbz+9g17zgJLEFjfJlZ6iifnpdLLtcaqq+l7OrJyjDXCwc2F7 + mww9sOA1iIX0+DaJo/pleX41qTbc13k9LpJIb0/KxrVNpdXFbaifWrZsTNVsKIHYCCVu + u3J9EK+OwYJel1gI0knod0VJqJ3hX8RPlr6jmLUi8W2f+iyz5MGhua8WeAyMlMi84Q7i + NrAw== +X-Gm-Message-State: AGRZ1gKEYIcUsbLoxcEFyal7YaC7sbRFViARpyoOBInGVrzLSvUwmyOJ + eGbnyefdD+ODhxGL8tXjQ3M= +X-Google-Smtp-Source: + AJdET5ex46kvaNnNGHWO8L5LavRH43RU/n/7AhJhW2Wy4eo+zIMlWK9hhTuXm+HSLMVGFmPvDQTGvQ== +X-Received: by 2002:adf:8141:: with SMTP id + 59-v6mr2197776wrm.127.1540378856365; + Wed, 24 Oct 2018 04:00:56 -0700 (PDT) +Received: from cperon-Latitude-7490.event.pylonone.net ([185.7.230.213]) + by smtp.gmail.com with ESMTPSA id + t194-v6sm6209850wmd.48.2018.10.24.04.00.55 + (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Wed, 24 Oct 2018 04:00:55 -0700 (PDT) +From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= <[email protected]> +To: Chris Ball <[email protected]>, + Ulf Hansson <[email protected]>, + Avri Altman <[email protected]>, linux-mmc at vger.kernel.org +Cc: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= <[email protected]> +Subject: [PATCH v2] mmc-utils: fix overlapping with strncpy +Date: Wed, 24 Oct 2018 13:00:47 +0200 +Message-Id: <[email protected]> +X-Mailer: git-send-email 2.19.1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Sender: linux-mmc-owner at vger.kernel.org +Precedence: bulk +List-ID: <linux-mmc.vger.kernel.org> +X-Mailing-List: linux-mmc at vger.kernel.org +X-Virus-Scanned: ClamAV using ClamSMTP + +GCC 8.2 warns about an overlapping using strncpy. + +Replace strncpy with a memmove to avoid this issue. + +In file included from /usr/include/string.h:494, + from lsmmc.c:46: +In function ?strncpy?, + inlined from ?read_file? at lsmmc.c:356:3: +/usr/include/x86_64-linux-gnu/bits/string_fortified.h:106:10: error: ?__builtin_strncpy? accessing 4096 bytes at offsets 0 and 1 overlaps 4095 bytes at offset 1 [-Werror=restrict] + return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +cc1: all warnings being treated as errors +make: *** [Makefile:36: lsmmc.o] Error 1 + +Signed-off-by: Cl?ment P?ron <[email protected]> +--- + +v2: + repost with Chris Ball + + lsmmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsmmc.c b/lsmmc.c +index c4faa00..bcb854d 100644 +--- a/lsmmc.c ++++ b/lsmmc.c +@@ -353,7 +353,7 @@ char *read_file(char *name) + line[strlen(line) - 1] = '\0'; + + while (isspace(line[0])) +- strncpy(&line[0], &line[1], sizeof(line)); ++ memmove(&line[0], &line[1], sizeof(line)-1); + + return strdup(line); + }
Signature · 1 line
2.16.4
PATCH 1/1 package/mmc-utils: add patch to fix build failure
Hello,
Quoted 9 lines · S?bastien Szymanski
Patch taken from:
- https://patchwork.kernel.org/patch/10654531/Fixes:
- http://autobuild.buildroot.net/results/404bfbd095a7b80273391ea36ea81ba496164b80
- http://autobuild.buildroot.net/results/233ef5c00951b5be10a59408f4a8781ecc658d74
- http://autobuild.buildroot.net/results/eba3cf4ac21095bca5af2d5d1d69aca0c9098f9bSigned-off-by S?bastien Szymanski <[email protected]>
Could you use a patch generated by git format-patch instead ?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 package/mmc-utils: add patch to fix build failure
Hi,
Quoted 6 lines · Thomas Petazzoni
Hello,
Quoted 3 lines · S?bastien Szymanski
Patch taken from:
- https://patchwork.kernel.org/patch/10654531/
Quoted 8 lines
Quoted 6 lines
Fixes:
- http://autobuild.buildroot.net/results/404bfbd095a7b80273391ea36ea81ba496164b80
- http://autobuild.buildroot.net/results/233ef5c00951b5be10a59408f4a8781ecc658d74
- http://autobuild.buildroot.net/results/eba3cf4ac21095bca5af2d5d1d69aca0c9098f9bSigned-off-by S?bastien Szymanski <[email protected]>Could you use a patch generated by git format-patch instead ?
Sure. I've just sent a v2.
Regards,
Quoted 5 lines
Thanks!
Thomas
Signature · 4 lines
S?bastien Szymanski Software engineer, Armadeus Systems Tel: +33 (0)9 72 29 41 44 Fax: +33 (0)9 72 28 79 26
PATCH 1/1 package/mmc-utils: add patch to fix build failure
Hi S?bastien,
Quoted 10 lines · S?bastien Szymanski
Quoted 9 lines · Thomas Petazzoni
Quoted 8 lines · S?bastien Szymanski
Patch taken from:
- https://patchwork.kernel.org/patch/10654531/Fixes:
- http://autobuild.buildroot.net/results/404bfbd095a7b80273391ea36ea81ba496164b80
- http://autobuild.buildroot.net/results/233ef5c00951b5be10a59408f4a8781ecc658d74
- http://autobuild.buildroot.net/results/eba3cf4ac21095bca5af2d5d1d69aca0c9098f9b
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by S?bastien Szymanski <[email protected]>Could you use a patch generated by git format-patch instead ?
Sure. I've just sent a v2.
I didn't get your v2 from the list. The list archive does not show it either:
http://lists.busybox.net/pipermail/buildroot/2018-November/thread.html
Care to send v2 again?
Thanks,
baruch
Signature · 3 lines
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -PATCH 1/1 package/mmc-utils: add patch to fix build failure
Hi Baruch,
Quoted 17 lines · Baruch Siach
Hi S?bastien,
Quoted 14 lines · S?bastien Szymanski
Quoted 12 lines · Thomas Petazzoni
Quoted 9 lines · S?bastien Szymanski
Patch taken from:
- https://patchwork.kernel.org/patch/10654531/Fixes:
- http://autobuild.buildroot.net/results/404bfbd095a7b80273391ea36ea81ba496164b80
- http://autobuild.buildroot.net/results/233ef5c00951b5be10a59408f4a8781ecc658d74
- http://autobuild.buildroot.net/results/eba3cf4ac21095bca5af2d5d1d69aca0c9098f9bSigned-off-by S?bastien Szymanski <[email protected]>Could you use a patch generated by git format-patch instead ?
Quoted 7 lines
Quoted 1 line
Sure. I've just sent a v2.
I didn't get your v2 from the list. The list archive does not show it either:
http://lists.busybox.net/pipermail/buildroot/2018-November/thread.html
Care to send v2 again?
The list archive now shows the v2:
http://lists.busybox.net/pipermail/buildroot/2018-November/235079.html
As usual it takes a long time (a few hours) for my mails to reach the mailing list.
Regards,
Quoted 4 lines
Thanks,
baruch
Signature · 4 lines
S?bastien Szymanski Software engineer, Armadeus Systems Tel: +33 (0)9 72 29 41 44 Fax: +33 (0)9 72 28 79 26