Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2597803ybi; Sun, 28 Jul 2019 12:46:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqQHt9qaT3sHjqnjPnZf/YHLEZINWuiwgjw8lFvHrpXyTZhVy/8GAV5NoeT49ZZ7GFXzko X-Received: by 2002:a17:902:2f84:: with SMTP id t4mr102842213plb.57.1564343191609; Sun, 28 Jul 2019 12:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564343191; cv=none; d=google.com; s=arc-20160816; b=K+lA20CqAs/7comRMw1rwu0ebN8LIwIQ3ehV4LnCNXtXJE1J1xLYIx0WC2DdN8Ppxk y4b0/nCW38ZnYAuzTrUHzSQCu4yo2nrgy39Rusu7ywtwXQ/QAEuJT8wBdXnMDVyKwSpY cW2yWRJHLlZRX5VEqvSXFOKgx4AR5NYaIAZ4Yp84Ud0tlX7wvdJfTdlkOyKaOxPJw93w G9FIwNv9Fqd4gOEYgfWE8psT+v+Y9ZT/GBhMyMCIJKBeS4kOfAGOsfDg/0SaqFWC4CW4 Pn45mhfgghpbYxl7d03g2efo3HJ2GJ7RvH/JmzRiQlDVeE6M+hDEcYooUfcKUtBEF9mt NQqA== 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; bh=ttR9V52iJaJEUdUsRKsHOgO0AkdZVFTfXeBkME6A4Pk=; b=kbL+Eb/+kHOS6pRxFt4P8ycwwD21LphTgrAO05heWaxc0KVhIdpdhwgGAqacq71Tu3 2JvxO6u0eOmAitARQ2fs3m8MLv+TpSQ8blvWMNvVg6tQVmk+slWOhkbnT0im6ldwpdVv J5KfKNkpFRTGyNfbDbJ9oCLV9Kk5Fb+hYVOylH7Ex8HROPA8ZcbYrZTo0OepvB00BIFY XOJo5bljbFL99Qn7JRbV3xYUUSjTfiazfcdhpVcCA7e/lfBxV2cH072q7wMNSHORonv1 EFotRqYR9xPKCK+hqv6CxMg97cz2BHnrm2iA3DiC5IGkBkNK4brQajVVvSOVmR3g41/A QaKA== 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 a14si24640153pfo.37.2019.07.28.12.46.16; Sun, 28 Jul 2019 12:46: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 S1726262AbfG1Tpj (ORCPT + 99 others); Sun, 28 Jul 2019 15:45:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45890 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726129AbfG1Tpj (ORCPT ); Sun, 28 Jul 2019 15:45:39 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 41F22C057E9F; Sun, 28 Jul 2019 19:45:39 +0000 (UTC) Received: from treble (ovpn-120-102.rdu2.redhat.com [10.10.120.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2628060600; Sun, 28 Jul 2019 19:45:35 +0000 (UTC) Date: Sun, 28 Jul 2019 14:45:33 -0500 From: Josh Poimboeuf To: Miroslav Benes Cc: jikos@kernel.org, pmladek@suse.com, joe.lawrence@redhat.com, live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] livepatch: Nullify obj->mod in klp_module_coming()'s error path Message-ID: <20190728194533.rghqjzwxyc2vwdvm@treble> References: <20190719122840.15353-1-mbenes@suse.cz> <20190719122840.15353-2-mbenes@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190719122840.15353-2-mbenes@suse.cz> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 28 Jul 2019 19:45:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 19, 2019 at 02:28:39PM +0200, 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. > > Signed-off-by: Miroslav Benes > Reviewed-by: Petr Mladek Acked-by: Josh Poimboeuf -- Josh