Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp982536imu; Mon, 5 Nov 2018 11:50:09 -0800 (PST) X-Google-Smtp-Source: AJdET5f5Rivq8BbeEC1eUVAj1O/yslCK3s0TPWebFqUA6Bx46tWHkhbwPesExz4aKWRmMl0/KxBr X-Received: by 2002:a62:6d83:: with SMTP id i125-v6mr3036873pfc.184.1541447409775; Mon, 05 Nov 2018 11:50:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541447409; cv=none; d=google.com; s=arc-20160816; b=rv/et3r6LUhSqmayBU3ZM1BBFedIbVi/hTwnpIHTo0nA9ldia4H/dG1NvrU7e1syUi Y8Iagmi3nbSHe+rrODqwKOPNx3Czy5G18rwRqu9I2Yv8NTupaM1YD1+OKHIOHuGcybCU +sRZgF7gx2ptwUpt8ah7eRJAsAcenlGk5oAmF6krUQ/KjkFYLtKnL2CgvF+5jjrNjb7p uuQQBKFdOx5Amum7BxSmgFHHHdNdpCXVErBbeJMhKJoKkezgtunZdVtu0txapdtaksXw jWJAGzZbN1Drfeq08szfuUG8MkeQDIovAelPZWHTwrQyhqpaQ6JijEcOi30/Cw1b6Set YTHw== 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=9gE1Npt0xNUbXRpU0Vz0jlrqkmo5xMYLG9g2KUA3gMY=; b=fiEbxG7Qcve26Rw0xf/0Id6zmgvBrFFabF/IG3b5Qk+y69WpewwCbIKmWIbOc1Td7F H64a9FikwRKZxTFNk7hCs+EBKm5GLmVC7NABTQ8/sFgemRJ7cSWcABzrie7bmBB+JA2h El8hDbdgcH1RT7JghsjCNw8gCj95hmsH4MBhTIPDe0gMCPKs+N4MNwGShwtXvkE1Qj3K AhT9AFzSg3Yzx0xyfhPHnshobPAl7jpN8h1yeupBb+oNpgtASoISElX2kr0q/SQVAPOo FFur0n5ka8XE5OcJIbFhKknvknwVwWDo2V4gfK+b2pWH+XSzuhqyvzITuG81nSDcg+iY qpYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GgwAhqAu; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o31si13137664pgb.273.2018.11.05.11.49.53; Mon, 05 Nov 2018 11:50:09 -0800 (PST) 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=@kernel.org header.s=default header.b=GgwAhqAu; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726790AbeKFFKu (ORCPT + 99 others); Tue, 6 Nov 2018 00:10:50 -0500 Received: from mail.kernel.org ([198.145.29.99]:46606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbeKFFKt (ORCPT ); Tue, 6 Nov 2018 00:10:49 -0500 Received: from redbean (ip5f5adbf7.dynamic.kabel-deutschland.de [95.90.219.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EAA0520685; Mon, 5 Nov 2018 19:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541447370; bh=oxxD/Ue4BKli74qshVxM/p19Z7685Npxu+mzjYjArR4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GgwAhqAuON5C6C0WVKRwh7IkeMBoCC/5kNpHc5dGLZXY3C6rpg8rbLAO3RL66vHL+ 1JNBFixhFol8dbLgWjadh+bHqNzjKJmPgLrAuF/2x0KrHSq3cd1CTpJblGM6h+FuOo N2k8IKQH7zjCnHn02uRKcPOCCx95MKhEIT1XL0YM= Date: Mon, 5 Nov 2018 20:49:09 +0100 From: Jessica Yu To: Will Deacon Cc: Torsten Duwe , Catalin Marinas , Julien Thierry , Steven Rostedt , Josh Poimboeuf , Ingo Molnar , Ard Biesheuvel , Arnd Bergmann , AKASHI Takahiro , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [PATCH v2] arm64/module: use plt section indices for relocations Message-ID: <20181105194909.djdmrpqkgu26nbp5@redbean> References: <20181001140910.086E768BC7@newverein.lst.de> <20181001141652.5478C68BE1@newverein.lst.de> <20181105175722.removbbpilqxu7tr@redbean> <20181105185323.hgoflyvkyujdyjxj@redbean> <20181105192637.GB25023@brain-police> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20181105192637.GB25023@brain-police> X-OS: Linux redbean 4.18.16-100.fc27.x86_64 x86_64 User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Will Deacon [05/11/18 19:26 +0000]: >On Mon, Nov 05, 2018 at 07:53:23PM +0100, Jessica Yu wrote: >> Instead of saving a pointer to the .plt and .init.plt sections to apply >> plt-based relocations, save and use their section indices instead. >> >> The mod->arch.{core,init}.plt pointers were problematic for livepatch >> because they pointed within temporary section headers (provided by the >> module loader via info->sechdrs) that would be freed after module load. >> Since livepatch modules may need to apply relocations post-module-load >> (for example, to patch a module that is loaded later), using section >> indices to offset into the section headers (instead of accessing them >> through a saved pointer) allows livepatch modules on arm64 to pass in >> their own copy of the section headers to apply_relocate_add() to apply >> delayed relocations. >> >> Signed-off-by: Jessica Yu >> --- >> >> v2: >> >> - Do sechdrs[pltsec->plt_shndx].sh_addr instead of pointer math >> >> Note: Addressed Will's comment about the pltsec -> plt_info rename and >> removed that change to reduce unnecessary code churn. I didn't include the >> Ack's for this reason so let me know if this version is OK as well. > >Thanks, Jessica! > >Acked-by: Will Deacon > >> arch/arm64/include/asm/module.h | 8 +++++--- >> arch/arm64/kernel/module-plts.c | 36 ++++++++++++++++++++---------------- >> arch/arm64/kernel/module.c | 9 +++++---- >> 3 files changed, 30 insertions(+), 23 deletions(-) > >Actually, I guess I should just queue this for 4.21 given that it's >completely self-contained. Yes, that's fine :-) Then Torsten won't have to include this patch to his patchset. Thank you! Jessica