Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6728862imu; Mon, 21 Jan 2019 14:41:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN79nN/dWemY1ZvuWf9dlXHBoTXN8ZZt4AIeGOvTkE9qHBj+x+Rb1Q/4VhaOGDtzkxT9vFB8 X-Received: by 2002:a17:902:7044:: with SMTP id h4mr31584665plt.35.1548110512938; Mon, 21 Jan 2019 14:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548110512; cv=none; d=google.com; s=arc-20160816; b=DbC8TugIDDK+an5UhczCN4/lFccjryFM4zTZASTfvYq/fwxSSnFezsO5TPqJeIk7gz RqJemYwuEz3abwsWUmlJkRmxMlg0ziURoYRND3lj+NOc8wSRwu4n5pygopmIrFEe9t53 8mFOfcSYxKXslAdrSgpr1KfQkv3j94kKELRK3R+abLz+3fLECemvQJYn/ily++l/Sqse 7tf3MltJFO2gXtf1/qvZnE1jhROBRDjtqrwHdnZjxj84rW2xfZoyIanMg6foHMwZhQZ8 qFX81FaPHXJDnYRwQ7Zj114WZGE4Z9Wp4iBFH0lxaF/K+9eFYeL5zBysltqQIlrSHvfD 0x+Q== 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=hFnpUSLcFgZnxzWw9Nl05MbbI+0Xb4EBjqNAjjiE/uA=; b=UVWg19H3h6RMkYVI6cgfrHOa6/qQe7DHBtAh0h4VqmJpJRpY+TpA4mq0pU+yO6aQPA Ys+UZW+QuR+uiXmueUreRKAeYwxj7E/kyUfAgPA9SkyAGhH1Rkmcx56mmjGXB4XG8dNf fyE/mQIQrcUYQQGjpihRQZATqBV3OnJPB1FxuftSpYuH9pVMu3JAmd6whKFru6yP9bhS UACaKUmhU4NwXeNI0ZZjPYq0Vc/fJCUApFVjx9PJ35swkpZG3tAtqcENfxKXqzLwxfCp Q+2BwutTnj6JsmttUWvXor53p/biFhF1InUWRhIvcuUr1oPKbC7KA5HcOmx4ivCBuOBV NRqA== 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 c6si13866946plo.270.2019.01.21.14.41.36; Mon, 21 Jan 2019 14:41:52 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbfAUWkQ (ORCPT + 99 others); Mon, 21 Jan 2019 17:40:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46902 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726290AbfAUWkP (ORCPT ); Mon, 21 Jan 2019 17:40:15 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A00C58762E; Mon, 21 Jan 2019 22:40:15 +0000 (UTC) Received: from redhat.com (dhcp-17-208.bos.redhat.com [10.18.17.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B464919744; Mon, 21 Jan 2019 22:40:14 +0000 (UTC) Date: Mon, 21 Jan 2019 17:40:12 -0500 From: Joe Lawrence To: Petr Mladek Cc: Jiri Kosina , Josh Poimboeuf , Miroslav Benes , Jason Baron , Evgenii Shatokhin , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] livepatch: Handle failing allocation of shadow variables in the selftest Message-ID: <20190121224012.GB8766@redhat.com> References: <20190116161720.796-1-pmladek@suse.com> <20190116161720.796-3-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190116161720.796-3-pmladek@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 21 Jan 2019 22:40:15 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 16, 2019 at 05:17:18PM +0100, Petr Mladek wrote: > Do not dereference pointers to the shadow variables when either > klp_shadow_alloc() or klp_shadow_get() fail. > > There is no need to check the other locations explicitly. The test > would fail if any allocation fails. And the existing messages, printed > during the test, provide enough information to debug eventual problems. > I didn't run the test under those failing conditions, but at looking at the code, I think it would simply skip the "expected found" and the test script would complain about not seeing that msg. Would it be easier to just bite the bullet and verify sv[0-4] at their allocation sites? Then later uses (ie, the sv3 dereference that Miroslav spotted at the bottom) or new code wouldn't fall through the cracks. -- Joe