From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-177.mta0.migadu.com (out-177.mta0.migadu.com [91.218.175.177]) (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 64FB933BBCF for ; Fri, 10 Apr 2026 07:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775805699; cv=none; b=n2a0p/nk8vYpDM062OUbu1eGOJgpeP97E44xF2OM8nE6uP1V7pISY5KfaX5OMxvqeipJVxNJHxTnxlMn9eF2+5c1lgv2czu30QdvCHVOJRQwe7NFJscpPBtiLfWyPIo1KrWHns7ftZis2YGhqCVSfgQ59y7lxOCtxT/2JtCjoQ8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775805699; c=relaxed/simple; bh=VftBf24PBfWIrHxnwDr0dFfIXqIx/etTeJIBb2TakN8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kTJ1JVgdSF9nQ/hsQcPgid/Q7pPzcPyXPAzZLpUiEbp+kiUjF2569hXuR6cJpcjTDmheXPMCl9s64piRywA/Dgcm+iRg4bB3mmWInc/+nPYBW3FOF4eAhU4+lmj7rpOMlvlwui8NK/y5zkWIXDBsJP94gTteMz000WNuzLHsyg8= 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=H6rQ4XTb; arc=none smtp.client-ip=91.218.175.177 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="H6rQ4XTb" Message-ID: <4e8460e6-94f6-4741-8f6c-4526684e3e72@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775805696; 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=soK4u9YPNKIB2aySBIAtKAE6J1ghvqjCGkOqIr/83O8=; b=H6rQ4XTb6pSzuAzd1bWguAhgbg+7AafAwsosWB1bHWZ4OfN7xJ5VEMDOu9VqmoEMzAWlbA /bJXuxJYdxowvnyuB8XHiukRJdGUoMSgYEWCOJhQ5vDsKY1SGZDXJfhr3xCLyvoi1q6KfJ RutaSJfhFQ7DUv4He9jL2qFTBTJ/n3s= Date: Fri, 10 Apr 2026 15:21:26 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v2 bpf-next 1/2] bpf: Fix Null-Pointer Dereference in kernel_clone() via BPF fmod_ret on security_task_alloc Content-Language: en-US To: Feng Yang , ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, eddyz87@gmail.com, memxor@gmail.com, song@kernel.org, yonghong.song@linux.dev, jolsa@kernel.org, john.fastabend@gmail.com, kpsingh@kernel.org, mattbobrowski@google.com, jiayuan.chen@linux.dev Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org References: <20260410061037.149532-1-yangfeng59949@163.com> <20260410061037.149532-2-yangfeng59949@163.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Leon Hwang In-Reply-To: <20260410061037.149532-2-yangfeng59949@163.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 10/4/26 14:10, Feng Yang wrote: > From: Feng Yang > [...] > + > +static int check_attach_sleepable(u32 btf_id, unsigned long addr, const char *func_name) > +{ > + /* fentry/fexit/fmod_ret progs can be sleepable if they are > + * attached to ALLOW_ERROR_INJECTION and are not in denylist. > + */ > + if (!check_non_sleepable_error_inject(btf_id) && > + within_error_injection_list(addr)) > + return 0; > + > + return -EINVAL; > +} > + > +static int check_attach_modify_return(unsigned long addr, const char *func_name) > +{ > + if (within_error_injection_list(addr) || > + !strncmp(SECURITY_PREFIX, func_name, sizeof(SECURITY_PREFIX) - 1)) > + return 0; > + > + return -EINVAL; > +} Why did you move them here? Seems that you didn't use them. > + > +static int modify_return_get_retval_range(const struct bpf_prog *prog, > + struct bpf_retval_range *retval_range) NIT: code format issue here. Thanks, Leon > +{ [...]