From patchwork Fri Jul 29 08:10:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 654027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3s11hB5rdDz9s3T for ; Fri, 29 Jul 2016 18:13:30 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=NwWkpVhL; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bT2tM-0003Cr-LT; Fri, 29 Jul 2016 08:11:36 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bT2tK-00036I-5F for lede-dev@lists.infradead.org; Fri, 29 Jul 2016 08:11:35 +0000 Received: by mail-wm0-x243.google.com with SMTP id i5so14572782wmg.2 for ; Fri, 29 Jul 2016 01:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=VeM20tw2Ellbv2Eu/4TD37gVmkTHT2oxH7UyOi4kzYQ=; b=NwWkpVhL1ngYTevS001zSdro/K5r6ifmyNWLHRG01GQSyFRcKEMZU2FmBRuZYUmcaC VlhfgzrS0rBO4/adweNru984Fxh378lSPO6op9mTPcHdtcIUyNlkixcy4UsbPjD2Aqee K/X8Jz7UJ/qt8KSLBnbxaXH1Om6La9i6a6smHqqx1XGiPzw01NOmKT3Qs4z349ez/egT JB80jYtAOZHSnhnQHce9hNdQa5TTuF96i6vV3hdzIr7A+PyU8rQh/ZzYfmdBCoKIq/Zb Dle49b+TzqK+2YkSIMzNrOU/f4OkGMaYwNkFvJxI+/pYHz8IQIeUlmBVUMDpWbL8BYde pU0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VeM20tw2Ellbv2Eu/4TD37gVmkTHT2oxH7UyOi4kzYQ=; b=JrbAgfcVhETa4V80n9uXnifvD8blOV/OFjtlY49+bkajskdfXpgZ1+lQ540XmVLEqd zquULPica9I8AO8m3TfZYg64iGExJeog9kOnurFKDhMYpCdjebA0p5GXl8f1KN183IPl h/Qoih9SruuyEW2H2APJs0eJ0pDB0k7uehNPW23Y9LNAaVgertDGd/YM6QeLwHfkl18g +OjoYaUwfRKvNPBDSMZ+Rfr6F3cVYZCGiLEOw5WHgKSuwxk3zAEOv1JoxufMgAuzr26i uEvuTNRRJARS1r6+LDGUYQY9Ai84Za3qUqnyFip61t6mVMHaILTxAP3WTL+ADU/N9kn5 +V9A== X-Gm-Message-State: AEkoous6GNiAjorcgS8480kF5ZIdM2td1M0BmOypVCSUTeHYmAg9SW7DShhUkSlfiFrWdw== X-Received: by 10.194.148.19 with SMTP id to19mr41101542wjb.81.1469779872515; Fri, 29 Jul 2016 01:11:12 -0700 (PDT) Received: from localhost.localdomain ([2001:470:9e39::48e]) by smtp.gmail.com with ESMTPSA id a203sm2269999wma.0.2016.07.29.01.11.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 Jul 2016 01:11:11 -0700 (PDT) From: Jonas Gorski To: lede-dev@lists.infradead.org Date: Fri, 29 Jul 2016 10:10:25 +0200 Message-Id: <1469779825-5352-1-git-send-email-jonas.gorski@gmail.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160729_011134_371893_072B77C6 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:243 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jonas.gorski[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH] ipq806x: fix boot hang if cmdline contains words with r in the middle X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Adrian Panella , Ash Benz , John Crispin MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The ATB DTB mangle code will enter an infinite loop if it encounters a word in the command line that contains an r in the middle of the word. Fix this by increasing ptr everytime before invoking strchr, ot avoid finding the same r again. This fixes booting at least on Netgear R7500v1, which contains "ubi.mtd=rootfs" in its commandline, triggering the misbehaviour. Fixes: 0ddcbee26151 ("ipq806x: activate ATAG DTB mangle and EA8500 rootblock in dts") Signed-off-by: Jonas Gorski --- This patch is also available in my staging tree at https://git.lede-project.org/?p=lede/jogo/staging.git;a=shortlog;h=refs/heads/ipq806x-next .../linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch index 8d5cbf9..be15ec4 100644 --- a/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch +++ b/target/linux/ipq806x/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch @@ -64,9 +64,9 @@ Signed-off-by: Adrian Panella + ptr = str - 1; + + do { -+ ptr++; + //first find an 'r' at the begining or after a space + do { ++ ptr++; + ptr = strchr(ptr, 'r'); + if(!ptr) return dest; +