Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3590483ybe; Sun, 15 Sep 2019 19:35:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzeuAlkjkHNnxwbQ0XN7XqLJL0OzYUVwWCTFYhhxeNYe2K96477B6c1BuBG2emMPglbZBWA X-Received: by 2002:a17:906:31c3:: with SMTP id f3mr50590415ejf.296.1568601336960; Sun, 15 Sep 2019 19:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568601336; cv=none; d=google.com; s=arc-20160816; b=R6wxjARrzEKFeq/+VPJqNBjIXS/0190EdsoxqZnj0ozE/yTugDHG9jNdhZ2hKbdAMX eS1BdklFidj3cLZUBQw9iir9wtpZdaJgDG0EaECM4cN9BrMxQRnWGq2+qtAoejn8Xp4b FjNMH+C/G2Cr5zNYFDyt8UAkqm1pQMzCnyCty/WVp3EYCgv5HvwP3ZKpcLwnJ5steECJ TOorCJiyanEFnkYRETVq9PCX1M52fZg/ocfp8p9+pONDubmMYrqKQR4NK+Xg4g8BVPOR 04rBz4ln7DW5h8Z4io78mZxaG0/RNrgcWjXp33ZNnPw+1S63+I/EzONfDX8jq23YJD6q LEKA== 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=AfjoPCOD52jjFgBq/i5FYuS0UjsI4UNOYM48ZVeX3bE=; b=fV4NE3WCp0Exh+DtOVksgEg/U83+6LAXUu4OIRvLr2DIhapR7OJxEDY+1bmjbWu2PZ JqFiEcHVcFV0QZzH9djqKaYJCgIxnQRLJgE6caeE7KnpPxvfoGJwFzWOhpSXF0pTtLL7 WW4Zqqd/QKEK6yJfvU6Tv/uO804Xfdci6riXtNrO4EBu/Xy2UsxH5utIfqs0WaFuTX6B Wu8jQH+DefmLZxkNa8Vu1K06AdzrBpAVOQljCnbwYqfQ7wPo2yzZQmust94o257MK8fW mN3WYs8yMgDpqnAPsDKtrNKFsa1Tnw3y9t6ZeYP9eFze63RGtM6IlJ+PLfggYQRvg0F1 iK6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tnPBDrO9; 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 y27si21170583edd.249.2019.09.15.19.35.13; Sun, 15 Sep 2019 19:35:36 -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=tnPBDrO9; 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 S1727309AbfIOWV6 (ORCPT + 99 others); Sun, 15 Sep 2019 18:21:58 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:45879 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfIOWV6 (ORCPT ); Sun, 15 Sep 2019 18:21:58 -0400 Received: by mail-qk1-f193.google.com with SMTP id z67so34232711qkb.12 for ; Sun, 15 Sep 2019 15:21:56 -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=AfjoPCOD52jjFgBq/i5FYuS0UjsI4UNOYM48ZVeX3bE=; b=tnPBDrO9qOYjSRmifs/kFutlE6E1HUrxpCCIivLA7x8+Zw4O1bf6X85jC7M7aumm5F N/L93c6/ZdO7Q1Qejnli6ibosiEaiAWwAsIeMVQbIP9uXou+LLBQ1Jl+nPf8SGR6JEPb 6AV7ySCf4N4HPU4FJzhLrs0ktYrGknOxPkRaJjLTC5K/lALC58JiAo+cW/f9sx9o7zmu 3rqGYI/62mDMUQ/kGN/wbpVPCra1e5cazfePzj/+AR7iP38W+UxErkwNf6hsL/rycTh3 pZpMd5b4FsuzaXnpo3OgDgi4sqaO5HTttg7UQn6gRa2jyLVYIdcSP4J07d9UeP2nTeFF r0Lg== 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=AfjoPCOD52jjFgBq/i5FYuS0UjsI4UNOYM48ZVeX3bE=; b=hC5GOOZubt4cBfO+ptxVrYmi2R7kYmDWptot+uWefwa0UWhDr9v14n0s4kneFvpdEn JWkX+qbIjeScBrimJyQVl5V51c0RRguGrc5uMOL/4uTH7nJqLGTUcMKsWskhG04Z0ItM 4QxQ0Eqdosfyv1U6Y4AMalb1y8pbzdM/uxe5EUh5CUM6V35qjs5OypB+o5IJVbjuaenE q3MYaDlqMJZxrNbj9jorIL7MCNfDbVgrFp9R1pBWV2fG6UEWPPbz0vs42QPc0Lz2KtNX FEHSPMjZacwMiqQvkPZq+bIhQix5Xqt/Ts/9WbJVfMu/uQY1ogN+V9/o8AWhyLS/UTNM pHdg== X-Gm-Message-State: APjAAAVOymE5ePENB5Czw8QPGjWvVL84tfqkHAoYXKko5OtwgIrw2wje GOdVqGkt+FnyjO6h+JCGhXzhya+utR1H/hNRLbi+ZwPKFu0= X-Received: by 2002:a37:b07:: with SMTP id 7mr56662105qkl.386.1568586115474; Sun, 15 Sep 2019 15:21:55 -0700 (PDT) MIME-Version: 1.0 References: <20190911141552.rtpdazx3ekfgsh3v@raspberrypi> In-Reply-To: <20190911141552.rtpdazx3ekfgsh3v@raspberrypi> From: Austin Kim Date: Mon, 16 Sep 2019 07:21:45 +0900 Message-ID: Subject: Re: [RESEND PATCH] ARM: module: Drop 'rel->r_offset < 0' statement To: Russell King - ARM Linux admin , allison@lohutok.net, info@metux.net, matthias.schiffer@ew.tq-group.com Cc: 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 Hello, Maintainer(Russell King)... Would you please update the feedback for this patch? 2019=EB=85=84 9=EC=9B=94 11=EC=9D=BC (=EC=88=98) =EC=98=A4=ED=9B=84 11:16, = Austin Kim =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > 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. > Also change %u to %d in pr_err() for rel->r_offset. > > Signed-off-by: Austin Kim > --- > arch/arm/kernel/module.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c > index deef17f34..f805bcbda 100644 > --- a/arch/arm/kernel/module.c > +++ b/arch/arm/kernel/module.c > @@ -92,8 +92,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab,= 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)) { > - pr_err("%s: section %u reloc %u sym '%s': out of = bounds relocation, offset %d size %u\n", > + if (rel->r_offset > dstsec->sh_size - sizeof(u32)) { > + pr_err("%s: section %u reloc %u sym '%s': out of = bounds relocation, offset %u size %u\n", > module->name, relindex, i, symname, > rel->r_offset, dstsec->sh_size); > return -ENOEXEC; > -- > 2.11.0 >