Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933669AbdGSTaU (ORCPT ); Wed, 19 Jul 2017 15:30:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50424 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932608AbdGSTaS (ORCPT ); Wed, 19 Jul 2017 15:30:18 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3F4C8624C4 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=yauheni.kaliuta@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3F4C8624C4 From: Yauheni Kaliuta To: Ard Biesheuvel Cc: Lucas De Marchi , linux-modules , lkml Subject: Re: [PATCH] libkmod-elf: resolve CRC if module is built with MODULE_REL_CRCS References: <20170719145649.20334-1-yauheni.kaliuta@redhat.com> Date: Wed, 19 Jul 2017 22:33:23 +0300 In-Reply-To: (Ard Biesheuvel's message of "Wed, 19 Jul 2017 20:10:17 +0100") Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 19 Jul 2017 19:30:18 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1649 Lines: 48 Hi, Ard! >>>>> On Wed, 19 Jul 2017 20:10:17 +0100, Ard Biesheuvel wrote: > On 19 July 2017 at 20:04, Yauheni Kaliuta wrote: >> Hi, Lucas! >> >>>>>>> On Wed, 19 Jul 2017 10:51:44 -0700, Lucas De Marchi wrote: >> > On Wed, Jul 19, 2017 at 7:56 AM, Yauheni Kaliuta >> > wrote: >> >> Normally exported symbol's crc is stored as absolute (SHN_ABS) >> >> value of special named symbol __crc_. >> >> >> >> When the kernel and modules are built with the config option >> >> CONFIG_MODULE_REL_CRCS, all the CRCs are put in a special section >> >> and the __crc_ symbols values are offsets in the >> >> section. See patch description of the commit: >> >> >> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=56067812d5b0e737ac2063e94a50f76b810d6ca3 >> >> >> >> Add kmod support of this configuration. >> >> [...] >> >> > LGTM. I'll give this a try and apply. >> >> Thanks! I would also like to get some feedback from the kernel feature >> author, Ard Biesheuvel, that this does not miss other usecases. >> > The patch looks correct to me. My only comment is that > kmod_elf_resolve_crc() should probably return a uint32_t instead, > given the size of a CRC32. Well, it's a specific of the internal libkmod implementation. Both struct kmod_modversion::crc and return value of elf_get_uint() are uint64_t, but in the patch elf_get_uint() reads correct sizeof(uint32_t) value from the ELF. > In any case, > Reviewed-by: Ard Biesheuvel Thanks a lot! -- WBR, Yauheni Kaliuta