From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932331AbcBCQPY (ORCPT ); Wed, 3 Feb 2016 11:15:24 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:38093 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753068AbcBCQPX (ORCPT ); Wed, 3 Feb 2016 11:15:23 -0500 Date: Wed, 3 Feb 2016 16:15:17 +0000 From: Paul Burton To: "Maciej W. Rozycki" CC: , Ralf Baechle , "James Hogan" , Andrey Konovalov , "Steven J. Hill" , Andrey Ryabinin , , Andrew Morton , "Maciej W. Rozycki" Subject: Re: [PATCH 1/5] MIPS: Bail on unsupported module relocs Message-ID: <20160203161517.GE30470@NP-P-BURTON> References: <1454471085-20963-1-git-send-email-paul.burton@imgtec.com> <1454471085-20963-2-git-send-email-paul.burton@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [10.100.200.164] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2016 at 12:24:38PM +0000, Maciej W. Rozycki wrote: > 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 Hi Maciej, To me fatality implies death, and nothing dies here. The module isn't loaded but that's done gracefully & is not likely due to an error in the kernel - it's far more likely that the module isn't valid. So to me, warning seems appropriate rather than implying an error in the kernel. Having said that I think it's a non-issue & don't really care either way, so if Ralf wants it to be pr_err fine. Thanks, Paul