Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3191874yba; Tue, 16 Apr 2019 06:38:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrpHSQedk/aLLR5pHNK3O8fqfO6qi6gGJWXQZJ5+/f6EYgrhnXM4SgXhnKB2bRC8meGVAR X-Received: by 2002:a17:902:1007:: with SMTP id b7mr58128987pla.48.1555421911235; Tue, 16 Apr 2019 06:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555421911; cv=none; d=google.com; s=arc-20160816; b=yJH1K/6l/ZEW1WzP+x1V5ZHhDIlH3NLLHTmxIngHhXRObJjnNVIqCWn7HvCIzOEvlb 0WEfrKBRMW7TJRJ6bQvtt8T3a0kSkHPOePBRPYp2O/wzmaFKCyG5rPV8SpnSbiXUyBTe 812IUpNn0MGs1gSSW5g9QVPu8t8JImjngTh4gZY56EBKZI4zPrLa9nVTEq7IWGqHTk04 z6UNeqVZjRy/YO0MkWRgsNO9j8Bt1YV/4MbtmQHt4t1go+x1N3r8xcFdMvoLDjcbCw7g WS9K9kaWmlnvlAH7qjw49gZ0TyEZ/r+z3S4yKAFPAGTN1IP/jIqvaTou8XQAZOoqs5o7 oPzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qRnft0YK/EnmUiBv0mY/XlAG7u/KlRcIxtgV+paRrBQ=; b=v7y8cTtvJORrwMqf5qphnx2Azt+mg0A4eGBBF2L0Qyfy1PKbwV3g6+JFnubbJRQkoO NiRmeUcNVrnzgA5ElRcB+LZwt5EiRFHq78tkj31FCzJ021NA+k3QNWOyFpa1A8DPAzwo dDFIbaanlNp09Lm6LPPl5cUnst0D1mG3sGt/BCj5I5/dYGwqugE79a7mn6Jy2+mvWaPz aj5egYpaD7kkRvFSM7XwMLxpjIsCDxgg+SHjdOTZC5+F1d8Axbw2fKRCPdRzfFKvmopR d9/5MSkWxXNj/L8v24bjTYH8qhWt2lNVRNQAA04My/DwtncKeevQsKsih+q/tTfozG+w s+0w== 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 1si24552645plk.14.2019.04.16.06.38.15; Tue, 16 Apr 2019 06:38:31 -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 S1729310AbfDPNhj (ORCPT + 99 others); Tue, 16 Apr 2019 09:37:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60364 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728032AbfDPNhj (ORCPT ); Tue, 16 Apr 2019 09:37:39 -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 E69783082206; Tue, 16 Apr 2019 13:37:38 +0000 (UTC) Received: from [10.18.17.208] (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 74BB95C22C; Tue, 16 Apr 2019 13:37:37 +0000 (UTC) Subject: Re: [PATCH v3 0/9] klp-convert livepatch build tooling To: Balbir Singh Cc: linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, linux-kbuild@vger.kernel.org, Jessica Yu , Jiri Kosina , Joao Moreira , Josh Poimboeuf , Konstantin Khlebnikov , Masahiro Yamada , Michael Matz , Miroslav Benes , Nicolai Stange , Petr Mladek References: <20190410155058.9437-1-joe.lawrence@redhat.com> <20190416052422.GA7482@350D> From: Joe Lawrence Message-ID: <57510765-be85-4f91-493b-f7213a7580f3@redhat.com> Date: Tue, 16 Apr 2019 09:37:36 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190416052422.GA7482@350D> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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.47]); Tue, 16 Apr 2019 13:37:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/16/19 1:24 AM, Balbir Singh wrote: > > Could we get some details with examples or a sample, sorry I might be dense > and missing simple information. The problem being solved is not clear to > me from the changelog. > Hi Balbir, I see that Miroslav has already pointed to documentation, samples and self-tests for the patchset, but here is a summary in my own words: kpatch-build constructs livepatch kernel modules by comparing a reference build with a patched build, combing through ELF object sections and extracting new and changed sections that include patched code. An alternative approach is "source-based", in which a livepatch kernel module is built (mostly entirely) using the kernel's build infrastructure. Sources for a livepatch are gathered ahead of time and then built like an ordinary kernel module. In either approach, there lies the problem of symbol visibility: how can a livepatch resolve symbols that a kernel module ordinarily can't. For example, file local or simply unexported symbols in across the kernel and other modules. Enter the concept of "livepatch symbols" described in module-elf-format.txt. kpatch-build already creates such "livepatch symbols" (see its create_klp_relasecs_and_syms()) and the livepatching core kernel code already knows how resolve such symbols at klp_object patch time (see klp_write_object_relocations()). The klp-convert tool and this supporting patchset would empower source-based-constructed livepatch modules to do the same. -- Joe