Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp993331ybe; Thu, 5 Sep 2019 08:49:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwRtBJOtbK5CKvMSotXr88Ei/q2XU1CCQMvJffOuRlV8ZYDNPdv7Lpi7Mn5RHfgnDP/YrFt X-Received: by 2002:a63:6407:: with SMTP id y7mr3773086pgb.188.1567698547236; Thu, 05 Sep 2019 08:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567698547; cv=none; d=google.com; s=arc-20160816; b=RyJWD4EXuEToWYhrI5yym3YlyvGK0AGIbDiSj1nxAYbZtALJZWhbpYvDOQYW6nvkZV qoS580hETM5/G4JHZUrgkvUcJ6ek2MrN2vABxu7Pj1XpbT6KWgpQi18YETWHW7tNIi41 35IocZvm57K4KeOX2RyQBUJ2Blpuqe88eO3fAROfioUpb/MnLw4AuxmGqKUklv8pgVNb LsiFhWNIlsqp8RSdAE4yMKgatkWzqKwd9WVqVR03v9wW37eFaFBpewzNfYfBZCpXXom2 cARa5b7wVl25qPPifH+RrjSdfO/m7Vzdo1XfejQCx6A40sTqEjjO6ZW50M8kssR+YWzQ T5YA== 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; bh=6kxl1x/RIfpf9JW23Br+zWT4O78X7v8V7f78aqiJau4=; b=CV/HRM1p8cISuh7oAWWEZAeHsLhQFTsCUjdlLfKj2smNjacaVlKyW20B2liTjwFeCP iGeVWSStwGpv4VS7w7DlhzeBCZC0LBguooAzUYqJB/36MThwNCJKTf5hadT2KaGmn7z0 +OEKU7iTqYgyJh6VN2m+nLMby8cj122cWa1AQFfLoj4/8B/DoECG5WspSlhRs7b7d87O fzIIGr/GN7jtG2LIY3b6iacsYY0BzYpjNueyNE9CteyTE+ljhuG3d7cvgClb8O47arqK mVhYiLt6yTXgMUOTdpU1/KqPKe64SdN+gJ/A1X+l6T+iq0VLOjD4tSLNaDdpeO+4JXA7 VSAw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si2061580pgq.586.2019.09.05.08.48.50; Thu, 05 Sep 2019 08:49:07 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389438AbfIEMgE (ORCPT + 99 others); Thu, 5 Sep 2019 08:36:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46922 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387436AbfIEMgE (ORCPT ); Thu, 5 Sep 2019 08:36:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EFE333090FDA; Thu, 5 Sep 2019 12:36:03 +0000 (UTC) Received: from treble (ovpn-120-170.rdu2.redhat.com [10.10.120.170]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D21A5C22C; Thu, 5 Sep 2019 12:35:59 +0000 (UTC) Date: Thu, 5 Sep 2019 07:35:58 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: Petr Mladek , Joe Lawrence , jikos@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: [RFC PATCH 2/2] livepatch: Clear relocation targets on a module removal Message-ID: <20190905123558.d4zh4h5pnej6pcuk@treble> References: <20190816094608.3p2z73oxcoqavnm4@pathway.suse.cz> <20190822223649.ptg6e7qyvosrljqx@treble> <20190823081306.kbkm7b4deqrare2v@pathway.suse.cz> <20190826145449.wyo7avwpqyriem46@treble> <5c649320-a9bf-ae7f-5102-483bc34d219f@redhat.com> <20190904084932.gndrtewubqiaxmzy@pathway.suse.cz> <20190905025055.36loaatxtkhdo4q5@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 05 Sep 2019 12:36:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 05, 2019 at 02:03:34PM +0200, Miroslav Benes wrote: > > > + I would like to better understand the scope of the current > > > problems. It is about modifying code in the livepatch that > > > depends on position of the related code: > > > > > > + relocations are rather clear; we will need them anyway > > > to access non-public (static) API from the original code. > > > > > > + What are the other changes? > > > > I think the .klp.arch sections are the big ones: > > > > .klp.arch.altinstructions > > .klp.arch.parainstructions > > .klp.arch.jump_labels (doesn't exist yet) > > > > And that's just x86... > > I may misunderstand, but we have .klp.arch sections because para and > alternatives have to be processed after relocations. And if we cannot get > rid of relocations completely, because of static symbols, then we cannot > get rid of .klp.arch sections either. With late module patching gone, the module code can just process the klp relocations at the same time it processes normal relocations. Then the normal module alt/para/jump_label processing code can be used instead of arch_klp_init_object_loaded(). Note this also means that Joe's patches can remove copy_module_elf() and free_module_elf(). And module_arch_freeing_init() in s390. > > And then of course there's the klp coming/going notifiers which have > > also been an additional source of complexity. > > True, but I think we (me and Petr) do not consider it as much of a problem > as you. It's less of an issue than .klp.arch and all the related code which can be removed. -- Josh