Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3810267imm; Mon, 11 Jun 2018 02:04:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK/lVpn3pGhGz1omf5NtQucop1yekoxXzhlpJrlFic9qxYsYaQWX/25XR0mLATvH1V7lYOH X-Received: by 2002:a65:4e8e:: with SMTP id b14-v6mr13667841pgs.392.1528707868833; Mon, 11 Jun 2018 02:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528707868; cv=none; d=google.com; s=arc-20160816; b=pLDiimxlvxZo8PuzVB6/OSkYXJY9cC8oleT4xrH0+5gi/jaO4IHEWn0aUPwbb9iYty iBETOcgaK7c8gi4XIbTsIqIAKcQHHG+WvEdTEJKnZJszz7z4qfsGbDbA0fCZFtp7bKDf 2HElOqU3ysOol/7MCrTGUBkwnQy6FjWYCcfowiVx71GqbN9b8zvVCEpGSNmoorPY6+X+ Gl3UR1C6/G/cwWqGpqS5fqVZsZVvQVFsjzecDKPsAPFfse1YnmATfdmQMVwqYXRFvx5x J/QOfPLaP6ZsLTrFhWztwILvCI9U8N8RnEyLiWztMejJekFBP1322O5fPsD24tRZcfz5 j1Vw== 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=iTtzscF/05+opRdzXrc0lL63W41MBDLtva7AlxS0eTM=; b=C7e7eDUII+BuB+yqdP59IzM1NyB6Jw2P8ogX+bYDT7a/afoIPqCEP34FD5gu+HoHzM FktTGDs+421wABnaJIV+chkZs8ZTSpOEfgVLw0TanL0T2wumkMSPHhuPHcbmIOqhFsiD wH2CfYnRQufj41ywGcZeOoLxK0Pd/B0vcJsDAz7Quog53zep67yWcjP9w+s1XJ4nb9eP +dAvDRmhuKapm2tdr5BwfbrsV91xUqTUutUysLHeYNIxn+A7NYV6k/sui6GUq/f8cv9V 9ybt2P8+N+RDgoch+TzIH3reaZq0YEAZLG+gRYEKdG9Sp+2UnOVmYZNWJZ4bZqTalHs9 Xkww== 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 e1-v6si64223529ple.195.2018.06.11.02.04.14; Mon, 11 Jun 2018 02:04:28 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932658AbeFKJDf (ORCPT + 99 others); Mon, 11 Jun 2018 05:03:35 -0400 Received: from mx2.suse.de ([195.135.220.15]:47485 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932538AbeFKJDd (ORCPT ); Mon, 11 Jun 2018 05:03:33 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 45A70AE5B; Mon, 11 Jun 2018 09:03:32 +0000 (UTC) Date: Mon, 11 Jun 2018 11:03:31 +0200 From: Petr Mladek To: Miroslav Benes Cc: jikos@kernel.org, jpoimboe@redhat.com, jeyu@kernel.org, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/3] livepatch: Nullify obj->mod in klp_module_coming()'s error path Message-ID: <20180611090331.deciyqbbql3h2e3o@pathway.suse.cz> References: <20180607092949.1706-1-mbenes@suse.cz> <20180607092949.1706-2-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180607092949.1706-2-mbenes@suse.cz> User-Agent: NeoMutt/20170421 (1.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2018-06-07 11:29:47, Miroslav Benes wrote: > klp_module_coming() is called for every module appearing in the system. > It sets obj->mod to a patched module for klp_object obj. Unfortunately > it leaves it set even if an error happens later in the function and the > patched module is not allowed to be loaded. > > klp_is_object_loaded() uses obj->mod variable and could currently give a > wrong return value. The bug is probably harmless as of now, but we're > gonna rely on klp_is_object_loaded() and correct obj->mod much more and > the bug would be visible then. > > Signed-off-by: Miroslav Benes Great catch! Reviewed-by: Petr Mladek Best Regards, Petr