Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp919512imu; Wed, 9 Jan 2019 08:31:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN46P55wWnt/NIsaFeX1I137Nm0LeFPR9jtGY5iPjNBDreF9GaZlwOI1pwXTSJ0fxcwP9vmY X-Received: by 2002:a63:fd53:: with SMTP id m19mr3829836pgj.340.1547051482995; Wed, 09 Jan 2019 08:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547051482; cv=none; d=google.com; s=arc-20160816; b=xrcirkLqyVVnygDkAh29c+FarfITl9qFMDHGus1JWLCt99k389mbu/4i7rJ/AFA/DR JRu1N+Ax2Ywl0d8a9J0q53x4A5nWGcAeyMEMAZmKv75sYTFBqAaGB7a3QPeezhDXNjlf XZlftx/SyiTNtI1yow5+zBT2smEfTQmuwJzE+ep+gCfHtGVnSymN+LAUqEv14ZjffcDI rEXRRYJ5OFzerHg0KMh3cCp1ONHpLw+kIinv1DOAAq/njq/jesV3SQrYcKwOMMAOQmL+ vGYSw32W+iCq4wQSgU4br3bGjQ7s882HkEHBsuykSIj5hovg0MeTHs75XBtdXQ8BrQoW 1+Mg== 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=yNlhrQBZsLYRU8aNDL2zGtSgQOps6hvX/Tk0nQLi4qo=; b=WX0WudqUxmx+q4PaliA4R1Ojechm7l+SNzyBn05C/AUM1f8fcK8iJi0elhxx1yUdBo fUR4JXgmxD37vw/RWFHw/NYUq8tTcnvF6GLE4YcCC+ZMHXNYe+ywJ2Q1U6BWUwO/eFdz nMWEvdqlx4dxAl7SW3z4hT9Pfi2oJiYaWbdNOwhxSymGbGEl9bj0aR2h1EBIr000yb1T 4oLicFWRhHoXEOmKUTaoDL5PULzYIjaP/hyaE38BwqCb/0vJQJ9WN1EE79zIJgXH/7Qw BiFh7QbRVZuLtXCpgWCnapwyDC4rD+LEiHVrTbqnHEwE1ObQyMDKqNw6nx77X77f8ZQb 6mSA== 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 e13si63867325pgh.251.2019.01.09.08.31.07; Wed, 09 Jan 2019 08:31:22 -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 S1732073AbfAIOuN (ORCPT + 99 others); Wed, 9 Jan 2019 09:50:13 -0500 Received: from mx2.suse.de ([195.135.220.15]:37104 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732063AbfAIOuL (ORCPT ); Wed, 9 Jan 2019 09:50:11 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 917F0ADE7; Wed, 9 Jan 2019 14:50:10 +0000 (UTC) Date: Wed, 9 Jan 2019 15:50:09 +0100 (CET) From: Miroslav Benes To: Petr Mladek cc: Jiri Kosina , Josh Poimboeuf , Jason Baron , Joe Lawrence , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v15 04/11] livepatch: Don't block the removal of patches loaded after a forced transition In-Reply-To: <20190109124329.21991-5-pmladek@suse.com> Message-ID: References: <20190109124329.21991-1-pmladek@suse.com> <20190109124329.21991-5-pmladek@suse.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 On Wed, 9 Jan 2019, Petr Mladek wrote: > module_put() is currently never called in klp_complete_transition() when > klp_force is set. As a result, we might keep the reference count even when > klp_enable_patch() fails and klp_cancel_transition() is called. > > This might give the impression that a module might get blocked in some > strange init state. Fortunately, it is not the case. The reference count > is ignored when mod->init fails and erroneous modules are always removed. > > Anyway, this might be confusing. Instead, this patch moves > the global klp_forced flag into struct klp_patch. As a result, > we block only modules that might still be in use after a forced > transition. Newly loaded livepatches might be eventually completely > removed later. > > It is not a big deal. But the code is at least consistent with > the reality. > > Signed-off-by: Petr Mladek > Acked-by: Joe Lawrence Acked-by: Miroslav Benes Miroslav