Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3055806yba; Sat, 18 May 2019 08:26:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxoGAtaKlDaO292gKQQRcNkjVAkFDotkkNx1UkkNRWIXdwkjUaQ/JVvnXeckyGMwCHWxjyK X-Received: by 2002:a65:578a:: with SMTP id b10mr47608578pgr.161.1558193167263; Sat, 18 May 2019 08:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558193167; cv=none; d=google.com; s=arc-20160816; b=RL+97wN0FXy9ECyCHDwOgkeTcUBjDdaESFr9XC/C6q6NHA1TVdcPMg8OExmTLNBvbv H6gkVcE5YUA151RWjPOb32Cogs25jKmib0QwCLK76kq/8HEcbxN9jEx0Qda3lVheTMQK i6XQt46AbS5GCf7lIJGarG1yFn9oCRCtdcl+FNHFYAR+XAD8mD1yaiKG7hENwFDV86z0 DmV5PXA9NOES7mvbOGBEFojOgXUSWlxzKsZahgRPny7EZpw/NKL6qy/j22Y9O2VWElXO JUnTr7tQAGNS6il/pFZqoScQY1NBiicHywDxaaogZl0tLpM6jdVkW7Uk7NJa0QIl1bBB mOCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date; bh=E+vZzXsyHxfJ0qwTnzKZx2eiw9IBgimP5kcz6tqb0Xc=; b=MEJB10N8b2y6NNL80zjj3ZlpnZj0bN3joUxuUgSOmUW6J1FJ3VgkOw9Fv1hTydZSvR S9wCs6UIYcYChFlWfEhOI9rky/DCD7iYUNZHmNejgdvAPIi8E492ND1Auw2GesxfAHdj 1M1arzmZjpOaXBYghATqgObcKAUP++nRTfCGz2S+4JEnkX/EhkDKtrtvxrMzoLRu2Z0n vCnN8f7jrOHResWqBN02f+ndmCIbBQKghTx1nrBFMMypNIsJj+Qt1EQ0+uKbNe0FtvcH AeNfLKpDx9gqpxjM+OEhGl3UgsSNlrG4MFathlb6Xsy7x+YFeheSCRDe9f+O5kEw+n0n AlJw== 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 t1si11910141pgh.406.2019.05.18.08.25.51; Sat, 18 May 2019 08:26:07 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729276AbfERNwZ (ORCPT + 99 others); Sat, 18 May 2019 09:52:25 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:43024 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728557AbfERNwY (ORCPT ); Sat, 18 May 2019 09:52:24 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4IDpNir027680 for ; Sat, 18 May 2019 09:52:23 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sjej779ck-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 18 May 2019 09:52:23 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 18 May 2019 14:52:21 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Sat, 18 May 2019 14:52:16 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4IDqFpp37814272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 13:52:15 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D9741A4054; Sat, 18 May 2019 13:52:15 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24114A405B; Sat, 18 May 2019 13:52:14 +0000 (GMT) Received: from JAVRIS.in.ibm.com (unknown [9.199.47.185]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sat, 18 May 2019 13:52:13 +0000 (GMT) Date: Sat, 18 May 2019 19:22:11 +0530 From: Kamalesh Babulal To: Joe Lawrence Cc: live-patching@vger.kernel.org, linux-kernel@vger.kernel.org, jikos@kernel.org, jpoimboe@redhat.com, pmladek@suse.com, tglx@linutronix.de Subject: Re: [PATCH] stacktrace: fix CONFIG_ARCH_STACKWALK stack_trace_save_tsk_reliable return References: <20190517185117.24642-1-joe.lawrence@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190517185117.24642-1-joe.lawrence@redhat.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-TM-AS-GCONF: 00 x-cbid: 19051813-0028-0000-0000-0000036F091B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19051813-0029-0000-0000-0000242EAA75 Message-Id: <20190518135211.GA17374@JAVRIS.in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-05-18_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180099 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 17, 2019 at 02:51:17PM -0400, Joe Lawrence wrote: > Miroslav reported that the livepatch self-tests were failing, > specifically a case in which the consistency model ensures that we do > not patch a current executing function, "TEST: busy target module". > > Recent renovations to stack_trace_save_tsk_reliable() left it returning > only an -ERRNO success indication in some configuration combinations: > > klp_check_stack() > ret = stack_trace_save_tsk_reliable() > #ifdef CONFIG_ARCH_STACKWALK && CONFIG_HAVE_RELIABLE_STACKTRACE > stack_trace_save_tsk_reliable() > ret = arch_stack_walk_reliable() > return 0 > return -EINVAL > ... > return ret; > ... > if (ret < 0) > /* stack_trace_save_tsk_reliable error */ > nr_entries = ret; << 0 > > Previously (and currently for !CONFIG_ARCH_STACKWALK && > CONFIG_HAVE_RELIABLE_STACKTRACE) stack_trace_save_tsk_reliable() > returned the number of entries that it consumed in the passed storage > array. > > In the case of the above config and trace, be sure to return the > stacktrace_cookie.len on stack_trace_save_tsk_reliable() success. > > Fixes: 25e39e32b0a3f ("livepatch: Simplify stack trace retrieval") > Reported-by: Miroslav Benes > Signed-off-by: Joe Lawrence Reviewed-by: Kamalesh Babulal