Received: by 10.213.65.68 with SMTP id h4csp41632imn; Fri, 6 Apr 2018 15:10:27 -0700 (PDT) X-Google-Smtp-Source: AIpwx497qvjfbpPRcMwJ7ovBmIhwQX6g8xWD2TVHgh9NQsQQT6TtiwBO1dCL1taNHa1Bkl0l06e1 X-Received: by 2002:a17:902:6e01:: with SMTP id u1-v6mr28588703plk.96.1523052627419; Fri, 06 Apr 2018 15:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523052627; cv=none; d=google.com; s=arc-20160816; b=ilEEKB8h9jIKXotbcGyQUs5D8VqIWM89uTfZAWVhzH3f2hG9xT44oNBWWU5tw+jaq8 kas2sW9MlTTfrPVt5+KcSujJPa55C0J9fiBIL+eZRJgOdKKDLwFRfK6qKI4HD/vGu5ii f7Nl6vEDmwf81l/CEU3R5+H/npFh4F1+ivmcqnVZHFtonAjioobjO2mYeGJpKnByb5m3 HQPdSRKMFNQIcz3WOOnVzqJnchElDw4la0VKo6gvfB1VxYrRXZuXrRl6xSKRh/kE6nl5 8p1A7BDzEbh447fNnwjxO679E3sSXhNneHJ0E+93DbiQ6O+kYqtx7Wrik+vk3W2fUfIn S1Gg== 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:arc-authentication-results; bh=1OgtLHrJqpg2lTDP2wQjxFqamSrWYMksB3mcr7oIizk=; b=Tya7nWrwPMsOQx4wII1/1zCy1XZlTWC+CNLrAzblEYtoA/Mr1q0atA4TlI0yDqyQE1 Bd0zmjcDThEzgctaMRbQKIolmjZgXzJbJR79vOQHW5fC7xj3q3cOBoJpKRnSp+qiR5C3 m6M8VBDbD69IkY0bKoDIC4J4RdNbfXPwo5mOz8dBqX1MvAS0yY1QKWQvf8HHtw0IZ68i zsZgtPfncV83Qr70csux5+WRJ1EnTg1wFVDDrWbKjGdeQtBTRwml3e8pYGVp5LRVXm0a teb2rCePXAXoczSOHvFuP5EdeLlM+NIRxnm5cDp8JP2i/860fy4paxj8ads4Zd7F1nzj dgew== 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 n6si7725294pgc.590.2018.04.06.15.09.49; Fri, 06 Apr 2018 15:10:27 -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 S1752283AbeDFWFd (ORCPT + 99 others); Fri, 6 Apr 2018 18:05:33 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751488AbeDFWFc (ORCPT ); Fri, 6 Apr 2018 18:05:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5280B402291E; Fri, 6 Apr 2018 22:05:31 +0000 (UTC) Received: from treble (ovpn-120-110.rdu2.redhat.com [10.10.120.110]) by smtp.corp.redhat.com (Postfix) with SMTP id 784322023227; Fri, 6 Apr 2018 22:05:30 +0000 (UTC) Date: Fri, 6 Apr 2018 17:05:30 -0500 From: Josh Poimboeuf To: Petr Mladek Cc: Jiri Kosina , Miroslav Benes , Jason Baron , Joe Lawrence , Jessica Yu , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/8] livepatch: Add atomic replace Message-ID: <20180406220530.snglx7m3quye34wp@treble> References: <20180323120028.31451-1-pmladek@suse.com> <20180323120028.31451-4-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180323120028.31451-4-pmladek@suse.com> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 06 Apr 2018 22:05:31 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 06 Apr 2018 22:05:31 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 23, 2018 at 01:00:23PM +0100, Petr Mladek wrote: > @@ -687,7 +858,14 @@ static void klp_free_patch(struct klp_patch *patch) > > static int klp_init_func(struct klp_object *obj, struct klp_func *func) > { > - if (!func->old_name || !func->new_func) > + if (!func->old_name) > + return -EINVAL; > + > + /* > + * NOPs get the address later. The the patched module must be loaded, "The the" -> "the" > + * see klp_init_object_loaded(). > + */ > + if (!func->new_func && !func->nop) > return -EINVAL; > > INIT_LIST_HEAD(&func->stack_node); > @@ -742,6 +920,9 @@ static int klp_init_object_loaded(struct klp_patch *patch, > return -ENOENT; > } > > + if (func->nop) > + func->new_func = (void *)func->old_addr; > + These changes make it more obvious that 'new_func' isn't quite the right name. It should really be 'new_addr' IMO. -- Josh