Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp782389ybe; Wed, 11 Sep 2019 04:45:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqzN+93s22tBtembY62FI453Yj19C1n4T97QUMGo8xGTqfaDIhoI7kdxF6z76nhLDSVxd/Wc X-Received: by 2002:a50:b329:: with SMTP id q38mr36074421edd.232.1568202310223; Wed, 11 Sep 2019 04:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568202310; cv=none; d=google.com; s=arc-20160816; b=IcMcDJagHGL0MwQTB7cgTA9V79st5LFaBUXyJj4tVvNxNrfw7kaJMFN2uKwFSAINUS ylvbfPnunWKvhrnj4ZiHKCxI+i1sElAF9BSpUbTKfkNsq4p4Z+hPXon6tunsc4209G3P NnqPC7jwelmEeuDBXNnnWDMgKNzYW4WlGJl2lxcWY5LDaxVFPql3VsJ2xLx3hIIYYW5G ujvHCuXQuYrcXK2n9GNsCJLDhpkbR9bPvt16qDjPn++3d7dfVjzWs/4sFpeEVwkfJDOn OX3e5OCWdjA00Leh7Ilugp7wpvvn8Q/dZ/aKq12OR17TSSkIxWCy8+FEd4nF9cFa5N9G Atjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=8+OX84D3OD8DVrZ9a7q2Ku1fRaie55mt1/8kXZjuUUE=; b=dPwclXaJf4pMhD9LNqxemJVA6B4w5Q/85LIveb/s4QWtWurA0Y9Wv10kJ4AVX7j/UL XWycgZxTZfIKn+Tx2/8eQ0usAHWN2NUAsvisbIhrOUTJCF+ICTCkcfd2Zoyf2v5iH77p 9zuaxWpifv1ub1Z/HoBdg6Pc98bg7gohM1BcBWdPaYP4NYaoap61MkSc11RqX+roRFdf KQeNC1KmaDQbBSBE7/x9HptGa2HpVA/3wbFqLBpJCTxBfyRy1U++HS5Sn/nJH5H15gyD Kd1s2eYBdtbyk5f1ckDb2gOK/GxCjiWR3ZNLBaiO8B1P/Qy/WVpFk+SnoDy6Ggea+zH5 mOgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dcdd0RrZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si13372771eda.53.2019.09.11.04.44.46; Wed, 11 Sep 2019 04:45:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dcdd0RrZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727696AbfIKLmw (ORCPT + 99 others); Wed, 11 Sep 2019 07:42:52 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:32823 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726793AbfIKLmw (ORCPT ); Wed, 11 Sep 2019 07:42:52 -0400 Received: by mail-qt1-f193.google.com with SMTP id r5so24832765qtd.0 for ; Wed, 11 Sep 2019 04:42:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=8+OX84D3OD8DVrZ9a7q2Ku1fRaie55mt1/8kXZjuUUE=; b=dcdd0RrZs3IuwCK0B9ztsaOEdtmef6QmlZkSJ4i9ttAnUde5fq6unM5o543/4nHt2b lSv1MI5CZUboFhMcEpVXc/wEmeP3GsK+whAWjMRvGYn4RKo8giZxaJuNDe/DBxYE/7Vr MMU6YZVXjFAEDCqr4Ay0EL2G4fDuwwYW/2jSnL8wZXaIokLsM5FNw2oVUASBCSlZ2aeU szi7kG67/hbyDHIGyGyC19oC3r/xUtSSVzVg8/yvAYoauf05JJr0eu4hNlW51dzaJjfM Tfgee44HF/AYXXt3SluHMBOgH7+gfn5ZHMR8JopogHm9LUf73hHJ+zgK5hZNUkT0Gfpq /+0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=8+OX84D3OD8DVrZ9a7q2Ku1fRaie55mt1/8kXZjuUUE=; b=HENTsbJj02ZDhF2sKeJV93t5ZD/qQi1xJBqXk3h74c1tgKEto5M3NHbH/VkeVW2qEv iOPIITPCPpihtQNRQEUamGGpZVpptugbjNA9tDU4WOKGWAZWeFh9xendgQ8e7F+wWHdi +KfgxNZsMUDXCeadXTFmRZUMWCcdqksv/wxbWG+88Q5DqPWLAD8fUI/A1VqX1oWTaYrw Kb5yDFjMW+qP1xEaXbjZt7p+4s74zASg4/DmgKpnrS4bCaSBPR4ZPnf0EMiUTZUmv0ZO JTM0UUCnmwEy/pLx6/t9KHEqdrViKV85+OSXJNx7C1Rhhb2/SykBxJfRN8yzQUR+UnaV M8oQ== X-Gm-Message-State: APjAAAVgNGWppy/4cK0BYSHrag4E70Rr3YHVQksULwogSiZl+wjA/62l 2xw32N98s3qCPrl2AWOeQxEWtaqnLhlEfPE72pw= X-Received: by 2002:ac8:51c4:: with SMTP id d4mr35213431qtn.17.1568202171389; Wed, 11 Sep 2019 04:42:51 -0700 (PDT) MIME-Version: 1.0 References: <20190911045408.GA62424@LGEARND20B15> <20190911094031.GU13294@shell.armlinux.org.uk> In-Reply-To: <20190911094031.GU13294@shell.armlinux.org.uk> From: Austin Kim Date: Wed, 11 Sep 2019 20:42:47 +0900 Message-ID: Subject: Re: [PATCH] ARM: module: Drop 'rel->r_offset < 0' always false statement To: Russell King - ARM Linux admin Cc: allison@lohutok.net, info@metux.net, matthias.schiffer@ew.tq-group.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2019=EB=85=84 9=EC=9B=94 11=EC=9D=BC (=EC=88=98) =EC=98=A4=ED=9B=84 6:40, R= ussell King - ARM Linux admin =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > On Wed, Sep 11, 2019 at 01:54:08PM +0900, Austin Kim wrote: > > Since rel->r_offset is declared as Elf32_Addr, > > this value is always non-negative. > > typedef struct elf32_rel { > > Elf32_Addr r_offset; > > Elf32_Word r_info; > > } Elf32_Rel; > > > > typedef __u32 Elf32_Addr; > > typedef unsigned int __u32; > > > > Drop 'rel->r_offset < 0' statement which is always false. > > > > Signed-off-by: Austin Kim > > --- > > arch/arm/kernel/module.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c > > index deef17f..0921ce7 100644 > > --- a/arch/arm/kernel/module.c > > +++ b/arch/arm/kernel/module.c > > @@ -92,7 +92,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strta= b, unsigned int symindex, > > sym =3D ((Elf32_Sym *)symsec->sh_addr) + offset; > > symname =3D strtab + sym->st_name; > > > > - if (rel->r_offset < 0 || rel->r_offset > dstsec->sh_size = - sizeof(u32)) { > > + if (rel->r_offset > dstsec->sh_size - sizeof(u32)) { > > pr_err("%s: section %u reloc %u sym '%s': out of = bounds relocation, offset %d size %u\n", > > Also change %d to %u here. Let me resend the patch with the change(%d to %u). Thanks, Austin Kim > > > module->name, relindex, i, symname, > > rel->r_offset, dstsec->sh_size); > > -- > > 2.6.2 > > > > > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbp= s up > According to speedtest.net: 11.9Mbps down 500kbps up