Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8827663ybl; Fri, 17 Jan 2020 01:42:52 -0800 (PST) X-Google-Smtp-Source: APXvYqy6Qtl38es651dKhJPfHcup8uKO/1+sZK/r3T2ArfNZJZmxO6ZIQDY11FqEpxsJfsnFtayU X-Received: by 2002:a05:6830:1e67:: with SMTP id m7mr5541141otr.262.1579254172059; Fri, 17 Jan 2020 01:42:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579254172; cv=none; d=google.com; s=arc-20160816; b=oTqF+LAezTl9yLWMuke94hUarsCIk78NkUZw/js9DLHdgDVwa8HZUI44XkQ7wAuVll QP833izkznNK/ZFExxFw2hW01lZ6x7xygYWdwOulswQ9hY6sIif8dcYlriuWcZlLVjW7 luE0WIPfgTQqBLofgaCjPKfpERD5j3/X2fyaFbWR8AgXqYqaxF87q5hRPn3RFPIaC5TC F9D0BbvBBVLVkQncGxn++CYxUh2bjGsa1GE4BLUpns4ymvYl8Fs/prCRgHumyzhQZ4eP hb3auNxoP6IqG0nX3K77Zh+YP2c/AS5a/rtmXn5kGQhFXfK5qcSS9jpYLaW8WRL3hD8E oYMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=B1/U6tlq8mA0aD3wo1gE1J9m67f/i5aoLGMzqqZsWLw=; b=WlLlz1xTil9Jfjv1qS5Vw6R9x/FMbMKc4Imdae+0eOideTHqyrqDGShSsV0I3ZC+4v i9qzQkGbG/7uhYK2dPexDJD64IM5C7/EVmwbQRMiBEH7okvxRSx2P5mTq2dpS6OtZnrg e2bARgXV3yqUXK/TlIWvAn6s0udyAT+Xw2LwVst9fA2YHhqB4OqSddeNCQv2kweGfy+w gm8QaEKTqzrCxDHriWg5Y37MJyz8YBmgbhmvjTKVhSNrboNTc/2YOAuQ5QLFEQkh1QSr y8rBVaPuQ1oRnkM7pKYSo/zp6csAV3m/FarGVpuK2qylRXliWrT7NsfcmzBa1Oqq1SyJ 288Q== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k84si13059113oib.46.2020.01.17.01.42.40; Fri, 17 Jan 2020 01:42: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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726196AbgAQJlh (ORCPT + 99 others); Fri, 17 Jan 2020 04:41:37 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:18500 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726596AbgAQJlh (ORCPT ); Fri, 17 Jan 2020 04:41:37 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 00H9caGF082908 for ; Fri, 17 Jan 2020 04:41:36 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2xk0qtpe1q-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 17 Jan 2020 04:41:36 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 17 Jan 2020 09:41:33 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 17 Jan 2020 09:41:31 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 00H9fUGv49807500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Jan 2020 09:41:30 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 382B652057; Fri, 17 Jan 2020 09:41:30 +0000 (GMT) Received: from JAVRIS.in.ibm.com (unknown [9.199.56.246]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTPS id A8A7052050; Fri, 17 Jan 2020 09:41:20 +0000 (GMT) Subject: Re: [PATCH 0/4] livepatch/samples/selftest: Clean up show variables handling To: Petr Mladek , Jiri Kosina , Josh Poimboeuf , Miroslav Benes Cc: Joe Lawrence , Nicolai Stange , Dan Carpenter , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200116153145.2392-1-pmladek@suse.com> From: Kamalesh Babulal Date: Fri, 17 Jan 2020 15:11:18 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200116153145.2392-1-pmladek@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 20011709-0020-0000-0000-000003A18536 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20011709-0021-0000-0000-000021F907A5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-01-17_02:2020-01-16,2020-01-17 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 malwarescore=0 clxscore=1015 mlxscore=0 suspectscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-2001170074 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/16/20 9:01 PM, 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(-) > Reviewed-by: Kamalesh Babulal -- Kamalesh