[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1602031139250.15885@tp.orcam.me.uk>
Date: Wed, 3 Feb 2016 12:24:38 +0000
From: "Maciej W. Rozycki" <macro@...tec.com>
To: Paul Burton <paul.burton@...tec.com>
CC: <linux-mips@...ux-mips.org>, Ralf Baechle <ralf@...ux-mips.org>,
James Hogan <james.hogan@...tec.com>,
Andrey Konovalov <adech.fo@...il.com>,
"Steven J. Hill" <Steven.Hill@...tec.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
<linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Maciej W. Rozycki" <macro@...ux-mips.org>
Subject: Re: [PATCH 1/5] MIPS: Bail on unsupported module relocs
On Wed, 3 Feb 2016, Paul Burton wrote:
> --- a/arch/mips/kernel/module-rela.c
> +++ b/arch/mips/kernel/module-rela.c
> @@ -134,9 +135,21 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
> return -ENOENT;
> }
>
> - v = sym->st_value + rel[i].r_addend;
> + type = ELF_MIPS_R_TYPE(rel[i]);
> +
> + if (type < ARRAY_SIZE(reloc_handlers_rela))
> + handler = reloc_handlers_rela[type];
> + else
> + handler = NULL;
>
> - res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
> + if (!handler) {
> + pr_warn("%s: Unknown relocation type %u\n",
> + me->name, type);
> + return -EINVAL;
Hmm, this looks like a fatal error condition to me, the module won't
load. Why `pr_warn' rather than `pr_err' then? Likewise in the other
file.
Maciej
Powered by blists - more mailing lists