Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp153520lqs; Mon, 4 Mar 2024 19:31:27 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVwqLuNHReFunXbI6MIHcGmMhZkMxdFVWDmtS2maepsCGRpVcEaqz013u6pgQYvn/WJMy3fRp1W6cRUvBZCTvmgB1d5imGErQWVsf7fQw== X-Google-Smtp-Source: AGHT+IGXxOP97dINHSRq9J0yEzE5mhFhydBIAda0g4LqwFLkBCMBsmoSP+uayM2KEcf3kTCw3TR8 X-Received: by 2002:aa7:c944:0:b0:566:18ba:6b80 with SMTP id h4-20020aa7c944000000b0056618ba6b80mr8602722edt.31.1709609486967; Mon, 04 Mar 2024 19:31:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709609486; cv=pass; d=google.com; s=arc-20160816; b=bqNu5pTaM68PkYjGqNIddiDz6QW0TxYnFAZBEa2gsS9zRTQCNWwLIa1RgDSJcWbji6 D7dPk3JA6UddtGPHcqQVmD/xJe+4QDmS/U/1rC1MRqsfPaCxu3M0jc36wtIEMGij17CX UzR3DQ/AytG9V1APWFIK2Paigf7wqTIeaaePBbh26Zxyy08Wb7z4K6UsarS4FrDaS/ce aClxPoepYP6VQrMZFrgTl+QO7bZKBueRDjsAaVOVwpeDkyQNhe6aMjLZhV1NkKIiYfDO PAv7f7iASQ/E7qqSkUjxtbEulJlclm5c9bK8wiCxTnK+hM1RWWmhzROJrt0ZB8/HOsz7 KV2Q== 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=WpEOCsMoFrFDQQ82vJpgHlUuGiMDrS6uwMoFfJkO9WE=; fh=ttZ+fWSZTIFITjnWwGnwR3Wggp1fxBLDVI7bhmqP0hQ=; b=FcMbggxmYUWLokKECjsUbUCwjDDDTq5XaGE7RRmtCAvDFkOEiFjm1+2lptJ5dtU7rt 8RdspwBwDu0QzcLyKLat8Ufs7pRMkXnjnOAjTsmT5GpbEX8fkGciNwZ1xlOg6N6aITcH TS+VsLOyrRNoh7sJYYUzxAxu0KDdvW7zHu+7ojuicFkaftz9ZO4A34madZG/B/pAHkF1 lFnGmw508ddmQ/UTGIRjOrgUNBC1IqCgFkqeOfgh193z5Gb9PAbYUCz3tAXPG4k5B67x 1I0kBMIi/uzHb13Nr8TE/tTw0pkCnZlG6Fq0Zdp+J8GZcLHPkQAqHHcFBQSXeg8diLPz CbQg==; 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-91620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91620-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id b14-20020aa7dc0e000000b005660baf9c8bsi4620468edu.518.2024.03.04.19.31.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 19:31:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-91620-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91620-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B2C631F24372 for ; Tue, 5 Mar 2024 03:31:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D519381D9; Tue, 5 Mar 2024 03:31:19 +0000 (UTC) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (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 52AB51E4A2; Tue, 5 Mar 2024 03:31:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709609478; cv=none; b=oGYkSjpNfKFckHClFZkzF5hzSlKmRXWjHatvsWLrIbVhJ5ZB+WYcwPCbdlXMECquS2ziiHr44UiDScr2WY0YzkWgfE4k34Y9YeMWMh4RwUqjnXu0o+xCUW2oBZvDdBnmIHk58qjQYbJ2jPxtO+Jv50JA5TCFqQMranPiKXm+HNs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709609478; c=relaxed/simple; bh=hz7TyFkMZdZVrncX6mmL6FjMOpB3oeS6eGxHwb8aECk=; h=Subject:To:References:CC:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=tXKEyVVlCLlkree7S9052nQAP2elHA+IsJ4q8PqxV6Tv2LWjjgVDxbNkzzN3prRl/0+rirXEov09YCFruLtJaf9Fm4maI0YWLSLlQxnydM3qd9f/kXLMURSwYCII8GlRUqPieKoJ3Zdio+WxjdYR6PJX/VCrg9SW4kINHu6l3rE= 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.187 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.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Tpgyv2TMfzsX7B; Tue, 5 Mar 2024 11:29:11 +0800 (CST) Received: from canpemm500010.china.huawei.com (unknown [7.192.105.118]) by mail.maildlp.com (Postfix) with ESMTPS id 7CF0C18005C; Tue, 5 Mar 2024 11:31:07 +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 11:31:07 +0800 Subject: Re: [PATCH] usercopy: delete __noreturn from usercopy_abort To: Kees Cook , Jann Horn References: <1709516385-7778-1-git-send-email-xiaojiangfeng@huawei.com> <202403040938.D770633@keescook> CC: , , , , , , , , , , , , , From: Jiangfeng Xiao Message-ID: <77bb0d81-f496-7726-9495-57088a4c0bfc@huawei.com> Date: Tue, 5 Mar 2024 11:31:06 +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: <202403040938.D770633@keescook> 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/5 1:40, Kees Cook wrote: > On Mon, Mar 04, 2024 at 04:15:07PM +0100, 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. > > FWIW, all email from huawei.com continues to get eaten by anti-spam > checking. I've reported this a few times -- it'd be really nice if the > domain configuration could get fixed. > >> [...] >>> 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. > > Yeah, NAK. usercopy_abort() doesn't return. It ends with BUG(). > When the user directly or indirectly calls usercopy_abort, the final call stack is incorrect, and the code where the problem occurs cannot be located. In this case, the user will be frustrated. For the usercopy_abort function, whether '__noreturn' is added does not affect the internal behavior of the usercopy_abort function. Therefore, it is recommended that '__noreturn' be deleted so that backtrace can work properly.