Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp660076ybe; Wed, 11 Sep 2019 02:43:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzV9l0xOnMeRldfY2tjTC+aVJNGSMD9ijj8IxN4FiZ2NQju2eOB6Wqh5yI6DpLcpJMECcq8 X-Received: by 2002:aa7:d414:: with SMTP id z20mr9803465edq.208.1568194983853; Wed, 11 Sep 2019 02:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568194983; cv=none; d=google.com; s=arc-20160816; b=I/vIhwdEsFLatjhdUCgXVyTJnuVNTAgFaIFY200/dihxeRHr4y5kzv61v+6c+HC/KH q+s6Kd3+2pEAWpE657Xj8UbM+x8ypLQwtuauZmoBjGry1+CxsZgIyrMxD28k6yI4rZ52 Dwcvh3V52kLzp/LFunki0jna6DlSdRisiCPGw17La5GwSg/3pm1C/TtDxeedt1hcye2l et235cARemtCiyfxVJ/44qvTjupM8BHkF6MwMquVu+erIa0XyNoux8GJhCjQwnBfSbF1 /+yNZaf7XojUayskkaUjdlapMReIIkctxuXe8BRkTdy0GDDnXjNIcpDwHyZJkoVBlNm9 dT8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bC+7AkqQohlcqRdZPZWKgGspys87RR8TikThWXhbXNk=; b=aTvSiqIvJSJER3/iHES0g2MDasThZpCpcNfiSYwjLckppXxOhIYHQb9a8Sz82ecoWI 29JPl0tdQFGftNr2zC884EOoVyuv4x7SQv6EyZ/o3UdedgQpYqgQmlwkraVFsGgGVRoG Z52BharIvCKSGkqeHIcQerzuP7xkFLtVx7BV6Ui1fGi2psKJRL+6PHXQbJBMg/3QKw21 hBDYzNU372l+3cKeX7b4ti9yGgsQfJF2V/5HHulIVHpE9qUHDORUWSIyXKoESJfrDtAt x/MfK9NzZ+Wa3tGqQORCuM273Vny+ECErPx086txfgagUfj4QvIXTHDhGOZ6QxDlDZ4j nkPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QYSGWD2E; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8si13495862edz.299.2019.09.11.02.42.39; Wed, 11 Sep 2019 02:43:03 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=QYSGWD2E; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbfIKJkn (ORCPT + 99 others); Wed, 11 Sep 2019 05:40:43 -0400 Received: from pandora.armlinux.org.uk ([78.32.30.218]:56468 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbfIKJkn (ORCPT ); Wed, 11 Sep 2019 05:40:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=bC+7AkqQohlcqRdZPZWKgGspys87RR8TikThWXhbXNk=; b=QYSGWD2EiaQUzRlWTWlgn9t1p W/ppZ+fmwlYPNZ79bENQJ1r4n36DdMI8pp6DZpgdOVraWQJ7vWsnADH5UQapBj9/KOnyXzj8U2YoL nFwyucdxReA1aVGBzEr6ZxmYqFwDDjDA727zWFagxlR1qHzAng0UE6GvVsdulucPKsvvnZULSj4bS NNEZE8qtmZcWFLAkMToYafM4hXwJtsT0t44EN00B3wtZRuLN+UZTD17K7k3F4Jl7mT0XWjbVjauvo v1cm6v8uunJ77/ah/rrA/FJOiv0MH4aMFvjA1XasiwEKj/hs5SYPBqgVN8yA5B02we607O6mKW4/9 ogS1saweA==; Received: from shell.armlinux.org.uk ([2002:4e20:1eda:1:5054:ff:fe00:4ec]:38166) by pandora.armlinux.org.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1i7z75-0005Vv-7r; Wed, 11 Sep 2019 10:40:35 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1i7z72-0003qa-4e; Wed, 11 Sep 2019 10:40:32 +0100 Date: Wed, 11 Sep 2019 10:40:32 +0100 From: Russell King - ARM Linux admin To: Austin Kim Cc: allison@lohutok.net, info@metux.net, matthias.schiffer@ew.tq-group.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ARM: module: Drop 'rel->r_offset < 0' always false statement Message-ID: <20190911094031.GU13294@shell.armlinux.org.uk> References: <20190911045408.GA62424@LGEARND20B15> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190911045408.GA62424@LGEARND20B15> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 *strtab, unsigned int symindex, > sym = ((Elf32_Sym *)symsec->sh_addr) + offset; > symname = 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. > 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 622kbps up According to speedtest.net: 11.9Mbps down 500kbps up