Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp141928lqs; Mon, 4 Mar 2024 18:56:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXKpkiskr0ZadxNc43Qesm/WXdN1mevcPJIq0not8kLz175aYklbgMn3GFX9UPYycVt6cTElbVHDZWRhk1OJiGKhLSgibqDAnBxMkj8tA== X-Google-Smtp-Source: AGHT+IHMN9tChmKif+TdxSY27j5+/zhBZaCI8rGPYJ2sD3XumZcErVyyT2/8Cywgt2RwsypiTNs4 X-Received: by 2002:a05:6870:210d:b0:21f:c7fa:78f5 with SMTP id f13-20020a056870210d00b0021fc7fa78f5mr622629oae.7.1709607382465; Mon, 04 Mar 2024 18:56:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709607382; cv=pass; d=google.com; s=arc-20160816; b=asr4NNOmyZ509kKq2D4YgVgZNR6lFnBBpQrsjUrcAduwhLj8IpNxvkuWXhkUMb24EI eFTv0efAb1a5eRpiEW06qUY/mpPpzJzPBwWORzen6Yo3rGvHBPQrDaFfoy5r/+9ud057 XDj/GyvfFKKDjNhLq5taIcpPnpY/HywWcRtxvsje/odY1Ga2DnQ0rYGKqSGsgXPEgu+3 3aclJ+pmdNM0XHlqGOKv6AxduSh/A1dgePfUwHbfsxClVdSNtHY6EwEFllxS/VMy2+lM 2gRdh5mgrlNEbpaXfEU8Qi9e8eNIKq2PbSw/gkK7knFox15FoovYcbxE2iYp1pwlbl6B B0QA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:user-agent:date:message-id:from :cc:references:to:subject; bh=0PNzBlgvWQlNy609aMLX3b+mPN/QUvXYDZKkFpp6U/g=; fh=VtsAaIYL2bd4B8QNItGpAnTqTQo/lCSv7XtW4GfoaiE=; b=G7iv5y1xaaUeR2roGWaCiYkfr/92HkIUYUQaZrFu3zzdcY1VYV0x8+Snwmlhpazk0X hvtvHlFGLNK+BH02UKIp1fwFObcCl3cWQ3FJWoQT9gB2Blr4lqjt4m+cAijW8yLaPqKi 4HGXzWbGt68kNQa0j+a2066uf6vJl5YiXbo2w7aIh/RinUP1oMi+5A5e2BkWtbkX0sl0 avf5sZmHzm6lxXu9QvWoFOV3PjpbcTceZfI+7DRMEoAr94iCHRjMJz4E+dS18piz45z1 juu9sxjBLVg+Nb6y2bECCvHIwFmOuHr64yCv+GxJrrvnCJnqr6zmk9A9nrK5BG699LIs SW5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-91585-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v9-20020a056a00148900b006e61ffc142bsi2940235pfu.10.2024.03.04.18.56.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 18:56:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91585-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-91585-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91585-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D61D2288CF4 for ; Tue, 5 Mar 2024 02:56:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 215C929415; Tue, 5 Mar 2024 02:56:17 +0000 (UTC) Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98A7028E02; Tue, 5 Mar 2024 02:56:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.191 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709607376; cv=none; b=D8uhxWBp5vQFCVztSHZwmVGJMk/Ras7pI8gwKl/KiMRUdR4T+6JovI/MGKH2XEKUwZORSRn12IjW8heOjDyprcZUO3Oo11Fk4JdCeek/JkKXskp2bQIwWu5cGI9XugNI34FlfrYQwCiZR+ijPvJKzoKFmL9ucso/zldkE+1N3MQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709607376; c=relaxed/simple; bh=nm0aa/Wui7JHK1QhSDJ6wB/F7wstMAU998YigIZupeY=; h=Subject:To:References:CC:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=AZJOwrem72btMo0vP71eoPVCbRY+PVSogVpufo4Qzi6pL/J/oIdAyZmyFBteCDyeecoSB3JldzeNCD7Xg4yGLSjEddaqmkdSdeYnWL4Bg9U1RiKfNopPQlBRm4DFFq5jIsyjOV9QBTz9kOcdUepyyY/rOfBKj3oVree7uPHOOJ8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.191 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.112]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4TpgB66kKKz1h1C5; Tue, 5 Mar 2024 10:53:50 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id B633C140158; Tue, 5 Mar 2024 10:55:55 +0800 (CST) Received: from [10.67.111.82] (10.67.111.82) by canpemm500010.china.huawei.com (7.192.105.118) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Tue, 5 Mar 2024 10:54:37 +0800 Subject: Re: [PATCH] usercopy: delete __noreturn from usercopy_abort To: Jann Horn References: <1709516385-7778-1-git-send-email-xiaojiangfeng@huawei.com> CC: , , , , , , , , , , , , , , From: Jiangfeng Xiao Message-ID: Date: Tue, 5 Mar 2024 10:54:32 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500010.china.huawei.com (7.192.105.118) On 2024/3/4 23:15, Jann Horn wrote: > On Mon, Mar 4, 2024 at 3:02 AM Jiangfeng Xiao wrote: >> When the last instruction of a noreturn function is a call >> to another function, the return address falls outside >> of the function boundary. This seems to cause kernel >> to interrupt the backtrace. > [...] >> Delete __noreturn from usercopy_abort, > > This sounds like the actual bug is in the backtracing logic? I don't > think removing __noreturn annotations from an individual function is a > good fix, since the same thing can happen with other __noreturn > functions depending on what choices the compiler makes. > . > Yes, you make a point. This may be a bug is in the backtracing logic, but the kernel backtracing always parses symbols using (lr) instead of (lr-4). This may be due to historical reasons or more comprehensive considerations. In addition, modifying the implementation logic of the kernel backtracing has a great impact. Therefore, I do not dare to modify the implementation logic of the kernel backtracing. Not all noreturn functions are ended with calling other functions. Therefore, only a few individual functions may have the same problem. In addition, deleting '__noreturn' from usercopy_abort does not change the internal behavior of usercopy_abort function. Therefore, there is no risk. Deleting '__noreturn' from usercopy_abort is the solution that I can think of with minimal impact and minimum risk. If you will submit a better patch to solve this problem, I would like to learn from you. Thank you.