Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8152388ybl; Thu, 16 Jan 2020 11:31:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxjEeDbg/r8AE8/V23k8lP1yt1zZThG6NuVvl2BZLFHcqrBCxutE9lgokoYUJkJHJXrmFif X-Received: by 2002:a54:4715:: with SMTP id k21mr503970oik.163.1579203113330; Thu, 16 Jan 2020 11:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579203113; cv=none; d=google.com; s=arc-20160816; b=ndvmVGFjN9gCv46R0TNqvAw2w6nl1A5BW1YL9llOT8BdPH9Q8zNAFn+csEYWIRTl8D iQmTrYpCGbdT/MFK1j5NbaRRgUOGzmKFYtAoL0bwjX+zcnxM5S99FbtvQNtPp1qmgrCo qek5zX85e3zjFE07lLlO/E9ZXjp1XkUzsj9lnpc0RvLjoyCdHE9cI5JZyk42qm7qkV/U QLJUP3oP+kml4FF4+UWi7I+YWdtzKMNAJkvZo3Ujj++r3yVvturTXL2xTEOBI//PZpcx Cz7qXIjJyuHdA0HwZrpIPfOby5+Hi2YOAeh2WnzDoWjtt5JMujwBuiSvYBljHTuJSh1l cgxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=XYLUC1KWAgys9j/fksF7kq8Qb7GODq8d0UQf27A4qzo=; b=bg4WiCYq43RU/Fgx0IaQKKw9mBVaxxB+6yzYskuwIdtSQShS2eijepVUzIPpljMdz/ EZwyaVP3iJBdUrsXEY6XboTKsCUwRd/bCWtWeFIjVgfYbSwJd4bKLJEAcZUCI1z+bPUZ +v6NwudmKxHz/xIBRe1JvfaUYb302dGqXy/jjVyiJagXd66DosglEkJI2vYE/fizff6J LGmSdr4rZwMd3MRCIQ1//s405iHJChd5/5ScOTaYomRCWIhxxgNMlHDuJH19Nfb3C/K7 +7vga/d1M64CV4rfYMCC6XL0jQBE5+QC6aQ3PIgnq6ZOBMMckUXHEmH78hOBMcCUGkuj ph7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZZa76D9C; 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=pass (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 i6si13341209otp.5.2020.01.16.11.31.39; Thu, 16 Jan 2020 11:31:53 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZZa76D9C; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730562AbgAPT3o (ORCPT + 99 others); Thu, 16 Jan 2020 14:29:44 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:30886 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730129AbgAPT3o (ORCPT ); Thu, 16 Jan 2020 14:29:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579202983; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XYLUC1KWAgys9j/fksF7kq8Qb7GODq8d0UQf27A4qzo=; b=ZZa76D9CE868aTEJaJXTgo/+6qIoE/yLZuZF8MjSYDx/dgh0EnEQlB/Wab5b+rA/9x5Wrm lkFC92atPW/ubzl/Qd+cU/2g67ZdIyYbK1wBjUHJZrbu9Ea3tB4LlXjn9dKydBheDRB8Dt 1lwq+1MnQXY1whxrIZipkVQ3E1qcTYw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-4-sJOwTwPEN8OLfffbnRrttQ-1; Thu, 16 Jan 2020 14:29:39 -0500 X-MC-Unique: sJOwTwPEN8OLfffbnRrttQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CC04118A8C80; Thu, 16 Jan 2020 19:29:37 +0000 (UTC) Received: from [10.18.17.119] (dhcp-17-119.bos.redhat.com [10.18.17.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C1DCE100032E; Thu, 16 Jan 2020 19:29:36 +0000 (UTC) Subject: Re: [PATCH 0/4] livepatch/samples/selftest: Clean up show variables handling To: Petr Mladek , Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Kamalesh Babulal , Nicolai Stange , Dan Carpenter , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200116153145.2392-1-pmladek@suse.com> From: Joe Lawrence Message-ID: Date: Thu, 16 Jan 2020 14:29:35 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200116153145.2392-1-pmladek@suse.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/16/20 10:31 AM, Petr Mladek wrote: > Dan Carpenter reported suspicious allocations of shadow variables > in the sample module, see > https://lkml.kernel.org/r/20200107132929.ficffmrm5ntpzcqa@kili.mountain > > The code did not cause a real problem. But it was indeed misleading > and semantically wrong. I got confused several times when cleaning it. > So I decided to split the change into few steps. I hope that > it will help reviewers and future readers. > > The changes of the sample module are basically the same as in the RFC. > In addition, there is a clean up of the module used by the selftest. > > > Petr Mladek (4): > livepatch/sample: Use the right type for the leaking data pointer > livepatch/selftest: Clean up shadow variable names and type > livepatch/samples/selftest: Use klp_shadow_alloc() API correctly > livepatch: Handle allocation failure in the sample of shadow variable > API > > lib/livepatch/test_klp_shadow_vars.c | 119 +++++++++++++++++------------- > samples/livepatch/livepatch-shadow-fix1.c | 39 ++++++---- > samples/livepatch/livepatch-shadow-fix2.c | 4 +- > samples/livepatch/livepatch-shadow-mod.c | 4 +- > 4 files changed, 99 insertions(+), 67 deletions(-) > Hi Petr, These are good cleanups, thanks for the fixes and tidying up all the pointer/value indirections. Reviewed-by: Joe Lawrence -- Joe