Received: by 10.223.176.5 with SMTP id f5csp2907865wra; Thu, 1 Feb 2018 07:52:32 -0800 (PST) X-Google-Smtp-Source: AH8x225rIWgwMfqNcoxJR94fqTVsp4jvgHE3Qdoiq8sZrpeMLT6dI9Ic/0IZo5JFvvcZyrvIIDrV X-Received: by 10.98.216.2 with SMTP id e2mr37107684pfg.151.1517500352452; Thu, 01 Feb 2018 07:52:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517500352; cv=none; d=google.com; s=arc-20160816; b=l0j343UGAaJ6lD4Vtk6fsLcu3Zz0t5so9FJJFMG5MYGQnT9LdjrLh+rETzw+KqgUDL AW/AcX2VPzxh8N5gf0FUCguI1QTYHmdhIH9zJvvEVnk3yvUPoy7E9LCOA3C3nux+PdSw IrasmB/+BrCnS7ai3kMG7Ibg7hS3yVe9THA55GrFNBBoIbPfptiX9HHpZpklBoRl0+Vj szhSuDXuVHrlAhY8URYFCZd4Pq62+gVplSJ5Sj7m3CdvvLjUeIEV8zYIuXnqNuXdZ3D2 90ZhZZj7xR1Sv2+wlXAp1v0Zp6sMOAGR5PZbvUSaJeNErsw+n5Hgt9rJXTCrcyBsqfEl 6Q7Q== 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 :arc-authentication-results; bh=sgq+EhYTuLIppwkowZI890AcayVanEDgbQmFnuoPcOA=; b=E015HsTGZAciHzwn3pEdyApWi9q8d1BfduTvmNWNEk6J8KsiFtlezLThmOLec4WnqA scxc+kuYwGjkVQuKu7MTkmgDtqI9tZbS7reBtK5vsMmiAy1zeG798mavxtXIx2OPxQhd fGhMIFHahdqyDwL4hRXyrOds8esHEDHB934TW4aLybEneq0RYl13hf3HDcqpvtGFhDTX 9TgWRcN18CsldWRMgjFzkPX54xJ44R9hKLVKZV2qdJcaRfvM4WmsoLBnjGTrT0fNE59x LnvEefwFm2HikSz3vjqxyC0G+MdSQUa7V0WtTDa+VO349DEjVh9xYPXGaas1K3BsunLQ regg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 8-v6si216642pla.105.2018.02.01.07.52.16; Thu, 01 Feb 2018 07:52:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752599AbeBAPvf (ORCPT + 99 others); Thu, 1 Feb 2018 10:51:35 -0500 Received: from mx2.suse.de ([195.135.220.15]:53674 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751935AbeBAPvc (ORCPT ); Thu, 1 Feb 2018 10:51:32 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CC81DACBB; Thu, 1 Feb 2018 15:51:30 +0000 (UTC) Date: Thu, 1 Feb 2018 16:51:28 +0100 (CET) From: Miroslav Benes To: Josh Poimboeuf cc: Joe Lawrence , Petr Mladek , jikos@kernel.org, Jason Baron , jeyu@kernel.org, Evgenii Shatokhin , linux-kernel@vger.kernel.org, live-patching@vger.kernel.org Subject: Re: PATCH v6 0/6] livepatch: Atomic replace feature In-Reply-To: <20180201151807.xjrldhmwwuot4c2o@treble> Message-ID: References: <20180125160203.28959-1-pmladek@suse.com> <1dd714ce-8d11-78b9-51f0-2b71734949e1@redhat.com> <20180201151807.xjrldhmwwuot4c2o@treble> 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 On Thu, 1 Feb 2018, Josh Poimboeuf wrote: > On Thu, Feb 01, 2018 at 04:08:14PM +0100, Miroslav Benes wrote: > > On Thu, 1 Feb 2018, Joe Lawrence wrote: > > > > > On 02/01/2018 08:49 AM, Miroslav Benes wrote: > > > > > > > > Well, one more thing. I think there is a problem with shadow variables. > > > > Similar to callbacks situation. Shadow variables cannot be destroyed the > > > > way it is shown in our samples. Cumulative patches want to preserve > > > > everything as much as possible. If I'm right, it should be mentioned in > > > > the documentation. > > > > > > Are you talking about using klp_shadow_free_all() call in a module_exit > > > routine? Yeah, I think in this case, that responsibility would be > > > passed to the newly loaded cumulative patch, right? > > > > Yes, but we haven't got an option not to call it here (as with callbacks, > > where we can omit callbacks completely with atomic replace patches). A > > live patch author must be aware of this and use shadow variables > > appropriately. > > So maybe we should recommend that shadow variables generally be freed > from a post-unpatch callback. Yes, that's a possibility. In other words, if there is a need to call klp_shadow_free_all() somewhere, it should be in a post-unpatch callback. Miroslav