From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (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 E99EB36073E for ; Thu, 2 Apr 2026 04:13:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775103201; cv=none; b=KprMvw8W3MbBgXsm1406DVhJpSFWv9xGOY+an5/VAlNDhwYQN9U/SPNkEi6zm+1YuZiYMsVIymlQ/vXApB0mVsZOzCWlT+zyE7TqoRVpfUhRW7jZ0PoxsNMGBjXp1+jKB3M8GxtL/NdNoCECbOi9DOHujZceam1rjkVpfbFPwTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775103201; c=relaxed/simple; bh=EZ5L9/8vCKGwNhWhMjSjHfJAz1UuMsebK0N3Q08CBDQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=uek58a8szhcOOX6SRFhFYB8VCpzPVEcqrj8yx8u/rCrklk6FFkD4HKkFwwJrMry4P/gPQgLlkk8zVbRsY352S1q5U4hUVOvNiW7SL1LQvNxf6M4pj3UiT+VZ7ekWBWU3wd7/M6ByRHRZ/TL+n94a4itHpQ4PqxhF9C/ZSWnUoaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=nwQ6P4pw; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nwQ6P4pw" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775103196; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qyDssAxOmEqYRcnBxOmr1uAqXti1Tp5or+KW3X9Gg88=; b=nwQ6P4pwOqzDhTpFlILFqdJtGlw21yGf4JISxn72gQGKv6pobyypFbyVSmyxNwvqmE2K+1 WFVWyU62MJKsius6dxf/ckqhZzvxx0nHd1vXm94Qk6jYZ65uCh8i2z3sC6u3vviGurJkx4 1MiF4Sn6zLfogeb2YP9XR2DicnnDJEg= Date: Thu, 2 Apr 2026 12:13:08 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf v3 1/2] bpf: Reject sleepable kprobe_multi programs at attach time Content-Language: en-US To: Varun R Mallya , bpf@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, memxor@gmail.com, yonghong.song@linux.dev, jolsa@kernel.org, rostedt@goodmis.org, mhiramat@kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org References: <20260401191126.440683-1-varunrmallya@gmail.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: <20260401191126.440683-1-varunrmallya@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2/4/26 03:11, Varun R Mallya wrote: > kprobe.multi programs run in atomic/RCU context and cannot sleep. > However, bpf_kprobe_multi_link_attach() did not validate whether the > program being attached had the sleepable flag set, allowing sleepable > helpers such as bpf_copy_from_user() to be invoked from a non-sleepable > context. > > This causes a "sleeping function called from invalid context" splat: > > BUG: sleeping function called from invalid context at ./include/linux/uaccess.h:169 > in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1787, name: sudo > preempt_count: 1, expected: 0 > RCU nest depth: 2, expected: 0 > > Fix this by rejecting sleepable programs early in > bpf_kprobe_multi_link_attach(), before any further processing. > > Fixes: 0dcac2725406 ("bpf: Add multi kprobe link") > Signed-off-by: Varun R Mallya Acked-by: Leon Hwang The cover letter is missing, and the change logs are missing, too. [...]