From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62FAD2DB7A3 for ; Tue, 12 May 2026 03:25:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778556308; cv=none; b=Qf3/VPigl/evAxVlz0z9t1uUwrrxQ176rjH36mxf9Hf/5y4FoayExJifK8qlqfSiUbFec2tH3uUihGCtnXgcQn0zSmgW4U3ogWY8Ykw5xQvF4NJEJ0f0g9j8pP5M78f0kKL/NSR6+jryKCQx8CKAv4nL+Joleyhc9xNf5JE+fmM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778556308; c=relaxed/simple; bh=lUvCSX7+f/zvgszpi8kv9Vx76od+XjPpIa3nZHTbWlk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=HKSRx+VdQlQ6e1UWwNOOTtFLnm1rFiUDJGD4/aMR7MRwjGBrqOzBdyGPfMato5KL36TggRVirxe2uSUxARGxXFz9cNDj+MhELzYw+haQn+mvdB9JAr7aqN3lQZ83CfuOsV8EVgNBhypORgmNivJ/+lchaSQ2Ukq5F8V5hWtS+y0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nMe15h3K; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nMe15h3K" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-42c08cbae4cso4047040fac.2 for ; Mon, 11 May 2026 20:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778556306; x=1779161106; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=lUvCSX7+f/zvgszpi8kv9Vx76od+XjPpIa3nZHTbWlk=; b=nMe15h3Kt/F1xKQNjMUk6LObJ5LuFYo5QiY/NkyxxEYuylqMPZx/SkvmaIJKbxPEmV gxr0XYumy5XuLF+ehZB9xiddLFaH2qhNa7U354IFnA117426oG8AwEzC2pMirc2Y7L2U P2Co3+7XzwLll1Hk0ebQ/OuJo1UYTtiL5RmumQTAGEeQ0d+ef0Rc+QRFI+XI+wQiNUKw M3dbFrplInf4HzFVPf3y6YGpGIHOOIBcZ6zlwSR5vfPjo1y+znvrchAJ6yj1b/CHzB2W +BgDDl1pmSvNW3kbqE6mfROqUbceJS1NeeahDOFNU+CWe5RHenud7XDUAHp0ejel65Bl mAGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778556306; x=1779161106; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lUvCSX7+f/zvgszpi8kv9Vx76od+XjPpIa3nZHTbWlk=; b=B0SlVJjmyhvlDMdZYBf/t/85guanVSzWP3BVBdns6WdZsBBhFkc1u95XggZ9prlcYv alf2zyjGUeQsCUUKX1GX4/m0yY4/e+KWiBGIFHg1S/VmyLPhXj0DrsrMcm+/kGFcEVRO pvTKy0fewhoCyFskxmuivsUGaRnUMagEv/uZ0dpztQcKawk+0JkwKirtXLilUVWDirYc R+tn4uS3f1HjJuHP0DvYDXBYS+nSWKAWzaKZ5Jzt3AvLtiO0pwSu/n/azBtZxnRQvAp0 QP2mPXuudrBTyYHwQ1eb26dSB9nowUu50WFaZ2KlvwHl0LDvRRkcyIvcORG9dW2NyOXd 1Cwg== X-Forwarded-Encrypted: i=1; AFNElJ97iqvoY4VxQWgwxs2i87iOI3lY6voFfCv9LbJ3+MWEpbHeT1GecykCdr+sNfsIpaw0q2QmpqY9prEUM2Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yyk+x0fTn+X6nkABEya1VbdV3OAtl7ELDh0sHHfm0vGx2npdqsW dAilO8BF45Q5eHe12ldDrHkalIppHFWrZzu69nRIbefK2D12lvPHCiZh X-Gm-Gg: Acq92OH3rhgFlhu7uEjosDaoGUQkbClEP1WSpaRtMjVqP8GgS5h4H6aRPfTBWY5YFhW 2AeJMb5UPCN05exp8E6HfTAB7fj/qgYe4kUhH7kAvRfn3T1esYud2jreI8G+iXWBGOLDFLWrIgl x0Cj667qXAMyvLRwEw1B4IkEmTUliGTqMk4rhDm0O6TtpeTeW4aRX40qseRHBgohiTV+Rs74zp8 Rmn6bj4cFbD31nz3B21X1RsEboLX1yG0r1RKZvnanfKbpbcjAlWF5L6oHkHhLa1LB8JxgZD/i0M FIAktdTKX8wh3wQ18now5bGB2BMoYB5QBER+zr+0WTRK9FWPf7gB89XVmVNk9jCWSk49b0qpJZb w1gPVgJhPK4NIP/pMICltfNP3KEPF4f3vqBX78bQevWYW/tJTg485spQxBc4d3ehhC+08bVvIVV zWAOnujxcKq1cjdoJgb7fRrqYyT9RHolnA6NsAYV8N/2ELKTIS4ffy9fHAEY26FNZmKsgc7HFnO JTSUdvKNz4es2JFWg== X-Received: by 2002:a05:6820:2212:b0:694:8bfa:7819 with SMTP id 006d021491bc7-69998cafb9emr14905097eaf.13.1778556306125; Mon, 11 May 2026 20:25:06 -0700 (PDT) Received: from localhost ([2a03:2880:10ff:43::]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-435570ad92dsm11696175fac.2.2026.05.11.20.25.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2026 20:25:04 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 11 May 2026 20:25:03 -0700 Message-Id: Cc: "Tejun Heo" , "Alexei Starovoitov" , "Eduard Zingerman" , "Andrii Nakryiko" , "David Vernet" , "Andrea Righi" , "Changwoo Min" , , , Subject: Re: [RFC PATCH 2/9] bpf/arena: Add BPF_F_ARENA_MAP_ALWAYS for direct kernel access From: "Alexei Starovoitov" To: "Kumar Kartikeya Dwivedi" , "Emil Tsalapatis" X-Mailer: aerc References: <20260427105109.2554518-1-tj@kernel.org> <20260427105109.2554518-3-tj@kernel.org> In-Reply-To: On Mon May 11, 2026 at 7:43 PM PDT, Kumar Kartikeya Dwivedi wrote: > > If not, the best course to me seems to be to make the flag behavior > default, and just rely on ASan (and Rust in the future) to prevent any > memory safety issues, and drop the stream based feedback on fault, > etc. Agree that this needs to be new default without new uapi flags. How about we tweak the idea further. Let all arena pages be unmapped initially. bpf progs will fault on them and will be reported via bpf_streams. But we also prepare one "scratch page". Let's use this name, since "garbage page" reads too dirty. When kernel faults we populate pte with that scratch page and let the kernel code retry. To implement it the page_fault_oops() can have a callback into bpf/arena helper similar to kfence_handle_page_fault. If fault address is in arena, do kfence_unprotect()-like.