Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3904311ybz; Tue, 28 Apr 2020 02:22:12 -0700 (PDT) X-Google-Smtp-Source: APiQypLICszHDtWR20WLeXXjrBha3C7Jnk0IKQkb4M0PEoPcZuc76FCNrSlLsC9kdndM5s38/Vbl X-Received: by 2002:a05:6402:311c:: with SMTP id dc28mr20741153edb.323.1588065732325; Tue, 28 Apr 2020 02:22:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588065732; cv=none; d=google.com; s=arc-20160816; b=FYj1btPO01hSmRQkdU85Jp/1rMlRTUFmisMKlTtTPHDQW9CuHRq7qanbOboCax/Fp6 xurcAtTbWnP8Kyk5BGDZC6YidA9A4eL19KVF/qoYadDurWX9bkyH6AhugnUAStllD41N ZA9gMZK5/Iz2P1YSbstU1A5fQVJ3paFFYPVvBI50SHIW881ecMqGmWuz3KvALGqFVEGz VAQ9i+pFVBEuik+7yH5YikT8N3YLKFNfURM6Xq4URPetkzJty/YUEDsbtAXTKKft7GKk gx/vgPntD2kdxHJ0UAc0vcVaPMYUyIalOFWa+yTyfBerhOYzLobMrkAMamsnqK4JoSTo uTCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=uTc4kYAo/MLMCo5mbGQCZzcHvwWAvXUL5l+zbCxVLpw=; b=bIBFudAo9elqBQ76QjZgBg2QTKVNENXnfqDn51EB8pdqh72HU3tDcYN4D85ofuoBaG 87VrFF/TB6rSYn/0+3KLzkj1zzh3ivzpDxzXEbCEKs+YOCcdAoySZAGTxoANTvI65Blv x3E5cFVPh8/TykDOMLf7EKxxt+Xt0cRWuFw+XiPB+zD929i0n+gVUl2vIw/gYrSh2uLX uXIfmLhLn6FGy8lUbrpzPMLUxnOEIbsgXsuAqQYrPUVoL5NHRhGjVc+4owLlU3k1ZNax wtUTJJ/yKzOOnEzr2g/VTt0iFvRgdD8OKJPOYWuyDBGytu4UcvHGRPhsVJkaSeeZpRBJ OF5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n24si1524169ejg.142.2020.04.28.02.21.48; Tue, 28 Apr 2020 02:22:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbgD1JUP (ORCPT + 99 others); Tue, 28 Apr 2020 05:20:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:60752 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727045AbgD1JUP (ORCPT ); Tue, 28 Apr 2020 05:20:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D8703ACCC; Tue, 28 Apr 2020 09:20:12 +0000 (UTC) Date: Tue, 28 Apr 2020 11:20:13 +0200 (CEST) From: Miroslav Benes To: Josh Poimboeuf cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Jessica Yu , Joe Lawrence Subject: Re: [PATCH v3 02/10] livepatch: Apply vmlinux-specific KLP relocations early In-Reply-To: <8c9f86b3a44bdcc9b350e41301df7f61c7587cf6.1587812518.git.jpoimboe@redhat.com> Message-ID: References: <8c9f86b3a44bdcc9b350e41301df7f61c7587cf6.1587812518.git.jpoimboe@redhat.com> User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > @@ -738,18 +765,23 @@ static int klp_init_object_loaded(struct klp_patch *patch, > int ret; > > mutex_lock(&text_mutex); > - > module_disable_ro(patch->mod); > - ret = klp_write_object_relocations(patch->mod, obj); > - if (ret) { > - module_enable_ro(patch->mod, true); > - mutex_unlock(&text_mutex); > - return ret; > + > + if (klp_is_module(obj)) { > + /* > + * Only write module-specific relocations here > + * (.klp.rela.{module}.*). vmlinux-specific relocations were > + * written earlier during the initialization of the klp module > + * itself. > + */ > + ret = klp_apply_object_relocs(patch, obj); > + if (ret) + module_enable_ro(patch->mod, true); + mutex_unlock(&text_mutex); is missing here, I think. Probably lost during rebase. It is fine after the next patch. > + return ret; > } > > arch_klp_init_object_loaded(patch, obj); > - module_enable_ro(patch->mod, true); > > + module_enable_ro(patch->mod, true); > mutex_unlock(&text_mutex); Miroslav