Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp731431ybm; Fri, 29 May 2020 10:46:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsfQ/mcrn9ixBdxl2ftxygzTy8ZJ6n/yO71BgrDzns639RoLcn/zEgtnEfAADTeEomFqIi X-Received: by 2002:a05:6402:31ba:: with SMTP id dj26mr9088467edb.360.1590774416919; Fri, 29 May 2020 10:46:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590774416; cv=none; d=google.com; s=arc-20160816; b=UcI7p6mQ39i+aYss3Ucf3aLJqCvRDgUmKl063G7P0Z3GSANVMaInlJ0elLZWzKSURm j2K3CrpCNajo5zGzopYyOvCpWctl5T1k1sdII8TUSYgrnACX1EI3fTD2MnfTmREFE6zY 3UsEZNhGvjJH8plx9JXSZdhfE59Qit2nuleE85+okDUBRFTAOFD30zEgKXR/NK1+8dkS Fjhaw8po0jD9eZo3PnjrISmnRX1U7vniOnYWAUL7ylJuWza+3JecuGs3BJeE7LVg9saQ V6FN3Ip2JqvgfqynEuNBX6H878upOLdr+Vg7JESXu5cB1vgiTtjm2uBNQXQ6qWhycLCW WD3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dTz4t9XSMrolUyKg6CsMoUPC7f/9JweFm6zuCIDCXNg=; b=an4jbeyllotr2utZBdO5jWxhJ0BRx4WNHEJwVL3jX8nuW6Q8TZQP0H1WxytZJ5vuGV m51Ebn5B+E7ZO6olF5y1ySlC90dnJcq7qrL35ARvX7RJ4Yn2tD0NpfsjvzOk+y7KIWin mbSV4U/pKpWmL7m6VDC/skbWlJQHBEwWiPwiDx8nczeIAiCuSe6qnYhGCUxc8RYNWPub UibnIL3uxvWIoPWWvDiTLDEBatQyvDYE2T5KvqvkiBMNbQmf6vhb9hswnb5F05/ISSmi zqzllQf1v5X39nL/VEnaq81JPdM261bynIkQRsq6xKp2XGxBhI2QrTwkj2mOVNDw9skB Wk6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jGCrhbdH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id k10si5913312edx.155.2020.05.29.10.46.33; Fri, 29 May 2020 10:46:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=jGCrhbdH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727090AbgE2Ros (ORCPT + 99 others); Fri, 29 May 2020 13:44:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26060 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726974AbgE2Ror (ORCPT ); Fri, 29 May 2020 13:44:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590774286; 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: in-reply-to:in-reply-to:references:references; bh=dTz4t9XSMrolUyKg6CsMoUPC7f/9JweFm6zuCIDCXNg=; b=jGCrhbdH2tf6fgYvG6tZJuvffy1eRR4xxdq5dKrrtBr4uSlwiImExkCV0rK+xpQDNZMNH8 PSEnswm2LXObPd2ZcCg3txYPsPj39YFqGFp6dWyDX1naR4+qdJPEfrJK+3fg6iJAYdn1n3 +xnBF5vrcQECPYKSghpB8A2SBkXiO1g= 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-287-TaVu2yjfOy2MO9txOqUAXw-1; Fri, 29 May 2020 13:44:42 -0400 X-MC-Unique: TaVu2yjfOy2MO9txOqUAXw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DAFE0107ACCA; Fri, 29 May 2020 17:44:40 +0000 (UTC) Received: from treble (ovpn-116-170.rdu2.redhat.com [10.10.116.170]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B75765C1B5; Fri, 29 May 2020 17:44:35 +0000 (UTC) Date: Fri, 29 May 2020 12:44:33 -0500 From: Josh Poimboeuf To: Wang ShaoBo Cc: huawei.libin@huawei.com, xiexiuqi@huawei.com, cj.chengjian@huawei.com, mingo@redhat.com, x86@kernel.org, linux-kernel@vger.kernel.org, live-patching@vger.kernel.org, mbenes@suse.cz, devel@etsukata.com, viro@zeniv.linux.org.uk, esyr@redhat.com Subject: Re: Question: livepatch failed for new fork() task stack unreliable Message-ID: <20200529174433.wpkknhypx2bmjika@treble> References: <20200529101059.39885-1-bobo.shaobowang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200529101059.39885-1-bobo.shaobowang@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 29, 2020 at 06:10:59PM +0800, Wang ShaoBo wrote: > Stack unreliable error is reported by stack_trace_save_tsk_reliable() when trying > to insmod a hot patch for module modification, this results in frequent failures > sometimes. We found this 'unreliable' stack is from task just fork. For livepatch, this shouldn't actually be a failure. The patch will just stay in the transition state until after the fork has completed. Which should happen in a reasonable amount of time, right? > 1) The task was not actually scheduled to excute, at this time UNWIND_HINT_EMPTY in > ret_from_fork() has not reset unwind_hint, it's sp_reg and end field remain default value > and end up throwing an error in unwind_next_frame() when called by arch_stack_walk_reliable(); Yes, this seems to be true for forked-but-not-yet-scheduled tasks. I can look at fixing that. I have some ORC cleanups in progress which are related to UNWIND_HINT_EMPTY and the end of the stack. I can add this issue to the list of improvements. > 2) The task has been scheduled but UNWIND_HINT_REGS not finished, at this time > arch_stack_walk_reliable() terminates it's backtracing loop for pt_regs unknown > and return -EINVAL because it's a user task. Hm, do you see this problem with upstream? It seems like it should work. arch_stack_walk_reliable() has this: /* Success path for user tasks */ if (user_mode(regs)) return 0; Where exactly is the error coming from? -- Josh