Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC8C5C6FD1D for ; Mon, 20 Mar 2023 15:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232950AbjCTP2F (ORCPT ); Mon, 20 Mar 2023 11:28:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232925AbjCTP1k (ORCPT ); Mon, 20 Mar 2023 11:27:40 -0400 Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CF0A37F0B; Mon, 20 Mar 2023 08:20:50 -0700 (PDT) Received: by mail-ed1-x52b.google.com with SMTP id w9so48224053edc.3; Mon, 20 Mar 2023 08:20:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679325648; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9Kw+qaW0IRgkPXI2zqL3VUWrpjrCLz4zhcfmeF4b5oA=; b=C5MmYe4hIyT+Y8n015wyAjPw9sbmwsnOwL0EYcCzMatk6V2UeEdFsIBWApWBC/JRH+ IzFVJp6kQ6UyD7VPU9rM2g6xQkJR9HdAvhqjTVVkC6wsv3MPqL/RA2huyAkX4ijUb3bq 11t9uV5QP+7qHjTC8ZmZnyuGLE9cy4A6zeYE3aJHRaA5VWonHd5ju6lHsKChZ7iaPIIo kFMvzed/JjSPTn9pgDxKMziaUvyWBHdoYvYynJdsMopzdgnOPxg5xyoX9XdC4r/XZMbN GcrXhR42MvmXJyXxOUj38F24XDCvYn/gVjIOm3bwEydBB2/02H8EkMsRf44aejX0LmZc 7RFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679325648; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Kw+qaW0IRgkPXI2zqL3VUWrpjrCLz4zhcfmeF4b5oA=; b=iUzn6jtoMV/VxstEXl2WooR31o7K36nu+Dmw+3EFdKfMrhb212kxWfrxkN+ZRPWsZ/ qJaiuaYK5g5xpoZWXr5XAuXEPshm3CSdTSxR24YSLfDHl0Z/7/8UHPlG2Ub0LAumHg04 iH/hHKPlHAwNA/et78bvtasDunG0jYpuWv4D/Yqep80lISJYz31BFZSFkC1PkYBQnHQk 8ATs8zsZyfdY9I/BsSCyDyO3LO+ezxijL/ofdUcCzQJFBVN217HluzD9ucq5Hv4Ol44o 9WdBzw27ZWJorqBmmamoixih22V830YTKQLoLxIEYcyEjGUoVDjxQajmBHaZ+u3j4zl7 NSYg== X-Gm-Message-State: AO0yUKWt1PmWKKptS6bZti1hu7178CF4/24lM5T+gjTTE23U66x0A+cX P8Ul8Y8veckCQwVQl6bn5SJZoaQD5zoS2SD15bY= X-Google-Smtp-Source: AK7set+Q0q+E+Sb7r+JKFFBfzrPzalPnaL3jlI25hjs4owdnUGqXQmQeZs5QC1jSLJ07ZIrQYRKsGqeRwskdeiuTu2U= X-Received: by 2002:a17:906:4d84:b0:92e:a234:110a with SMTP id s4-20020a1709064d8400b0092ea234110amr4340421eju.3.1679325648130; Mon, 20 Mar 2023 08:20:48 -0700 (PDT) MIME-Version: 1.0 References: <20230317035227.22293-1-starmiku1207184332@gmail.com> <20230317171636.ftelyp6ty7mgo4rt@dhcp-172-26-102-232.dhcp.thefacebook.com> <20230319164714.zu6kqylibrzug4ja@dhcp-172-26-102-232.dhcp.thefacebook.com> In-Reply-To: From: Alexei Starovoitov Date: Mon, 20 Mar 2023 08:20:36 -0700 Message-ID: Subject: Re: [PATCH v2] kernel: bpf: stackmap: fix a possible sleep-in-atomic bug in bpf_mmap_unlock_get_irq_work() To: Teng Qi Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf , LKML , baijiaju1990@outlook.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 20, 2023 at 5:28=E2=80=AFAM Teng Qi wrote: > > Yeah, we got your points. There are two key questions. The first question= is > that preempt_disable() and preempt_enable() will be conflicted with vfree= () > before the mmap_read_unlock(). What does this sentence mean? > The second question is that thousands callers > of up_read() only make sure irqs_disabled() =3D=3D false needed fixed if > the mmap_read_unlock() is fixed. that doesn't answer my question either. > Detecting ebpf bugs can be challenging since it is difficult to prove tha= t a > bug can be triggered during runtime, as well as fixing the bug. We decide= d to > give up this patch that fixes the possible sleep-in-atomic bug in > bpf_mmap_unlock_get_irq_work(). Instead, we will focus on improving our s= tatic > analysis tool to find ebpf-specific bugs. Please don't.