All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Puranjay Mohan <puranjay@kernel.org>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH stable linux-5.10.y v1 1/8] bpf: Introduce composable reg, ret and arg types.
Date: Wed, 11 Jun 2025 09:16:05 -0400	[thread overview]
Message-ID: <20250610165605-0d8fabc4a4ee9ec5@stable.kernel.org> (raw)
In-Reply-To: <20250610144407.95865-2-puranjay@kernel.org>

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: d639b9d13a39cf15639cbe6e8b2c43eb60148a73

WARNING: Author mismatch between patch and upstream commit:
Backport author: Puranjay Mohan<puranjay@kernel.org>
Commit author: Hao Luo<haoluo@google.com>

Status in newer kernel trees:
6.15.y | Present (exact SHA1)
6.14.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
6.1.y | Present (exact SHA1)
5.15.y | Present (different SHA1: a76020980b9f)

Note: The patch differs from the upstream commit:
---
1:  d639b9d13a39c ! 1:  b9a913ca98c49 bpf: Introduce composable reg, ret and arg types.
    @@ Metadata
      ## Commit message ##
         bpf: Introduce composable reg, ret and arg types.
     
    +    commit d639b9d13a39cf15639cbe6e8b2c43eb60148a73 upstream.
    +
         There are some common properties shared between bpf reg, ret and arg
         values. For instance, a value may be a NULL pointer, or a pointer to
         a read-only memory. Previously, to express these properties, enumeration
    @@ Commit message
     
         Signed-off-by: Hao Luo <haoluo@google.com>
         Signed-off-by: Alexei Starovoitov <ast@kernel.org>
    +    Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
         Link: https://lore.kernel.org/bpf/20211217003152.48334-2-haoluo@google.com
    +    Cc: stable@vger.kernel.org # 5.10.x
     
      ## include/linux/bpf.h ##
     @@ include/linux/bpf.h: bool bpf_map_meta_equal(const struct bpf_map *meta0,
    @@ include/linux/bpf.h: bool bpf_map_meta_equal(const struct bpf_map *meta0,
      enum bpf_arg_type {
      	ARG_DONTCARE = 0,	/* unused argument in helper function */
     @@ include/linux/bpf.h: enum bpf_arg_type {
    - 	ARG_PTR_TO_CONST_STR,	/* pointer to a null terminated read-only string */
    - 	ARG_PTR_TO_TIMER,	/* pointer to bpf_timer */
    + 	ARG_PTR_TO_BTF_ID_SOCK_COMMON,	/* pointer to in-kernel sock_common or bpf-mirrored bpf_sock */
    + 	ARG_PTR_TO_PERCPU_BTF_ID,	/* pointer to in-kernel percpu type */
      	__BPF_ARG_TYPE_MAX,
     +
     +	/* This must be the last entry. Its purpose is to ensure the enum is
    @@ include/linux/bpf.h: enum bpf_arg_type {
      /* type of values returned from helper functions */
      enum bpf_return_type {
     @@ include/linux/bpf.h: enum bpf_return_type {
    + 	RET_PTR_TO_BTF_ID_OR_NULL,	/* returns a pointer to a btf_id or NULL */
      	RET_PTR_TO_MEM_OR_BTF_ID_OR_NULL, /* returns a pointer to a valid memory or a btf_id or NULL */
      	RET_PTR_TO_MEM_OR_BTF_ID,	/* returns a pointer to a valid memory or a btf_id */
    - 	RET_PTR_TO_BTF_ID,		/* returns a pointer to a btf_id */
     +	__BPF_RET_TYPE_MAX,
     +
     +	/* This must be the last entry. Its purpose is to ensure the enum is
    @@ include/linux/bpf.h: enum bpf_return_type {
      /* eBPF function prototype used by verifier to allow BPF_CALLs from eBPF programs
       * to in-kernel helper functions and for adjusting imm32 field in BPF_CALL
     @@ include/linux/bpf.h: enum bpf_reg_type {
    - 	PTR_TO_FUNC,		 /* reg points to a bpf program function */
    - 	PTR_TO_MAP_KEY,		 /* reg points to a map element key */
    - 	__BPF_REG_TYPE_MAX,
    + 	PTR_TO_RDWR_BUF,	 /* reg points to a read/write buffer */
    + 	PTR_TO_RDWR_BUF_OR_NULL, /* reg points to a read/write buffer or NULL */
    + 	PTR_TO_PERCPU_BTF_ID,	 /* reg points to a percpu kernel variable */
    ++	__BPF_REG_TYPE_MAX,
     +
     +	/* This must be the last entry. Its purpose is to ensure the enum is
     +	 * wide enough to hold the higher bits reserved for bpf_type_flag.
    @@ include/linux/bpf.h: enum bpf_reg_type {
     
      ## include/linux/bpf_verifier.h ##
     @@ include/linux/bpf_verifier.h: int bpf_check_attach_target(struct bpf_verifier_log *log,
    + 			    u32 btf_id,
      			    struct bpf_attach_target_info *tgt_info);
    - void bpf_free_kfunc_btf_tab(struct bpf_kfunc_btf_tab *tab);
      
     +#define BPF_BASE_TYPE_MASK	GENMASK(BPF_BASE_TYPE_BITS - 1, 0)
     +
    @@ include/linux/bpf_verifier.h: int bpf_check_attach_target(struct bpf_verifier_lo
     +{
     +	return type & ~BPF_BASE_TYPE_MASK;
     +}
    - 
    ++
      #endif /* _LINUX_BPF_VERIFIER_H */
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-5.10.y       |  Success    |  Success   |

  reply	other threads:[~2025-06-11 13:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 14:43 [PATCH stable linux-5.10.y v1 0/8] Fix bpf mem read/write vulnerability Puranjay Mohan
2025-06-10 14:43 ` [PATCH stable linux-5.10.y v1 1/8] bpf: Introduce composable reg, ret and arg types Puranjay Mohan
2025-06-11 13:16   ` Sasha Levin [this message]
2025-06-10 14:43 ` [PATCH stable linux-5.10.y v1 2/8] bpf: Replace ARG_XXX_OR_NULL with ARG_XXX | PTR_MAYBE_NULL Puranjay Mohan
2025-06-11 13:15   ` Sasha Levin
2025-06-10 14:43 ` [PATCH stable linux-5.10.y v1 3/8] bpf: Replace RET_XXX_OR_NULL with RET_XXX " Puranjay Mohan
2025-06-11 13:24   ` Sasha Levin
2025-06-10 14:43 ` [PATCH stable linux-5.10.y v1 4/8] bpf: Replace PTR_TO_XXX_OR_NULL with PTR_TO_XXX " Puranjay Mohan
2025-06-11 13:16   ` Sasha Levin
2025-06-10 14:44 ` [PATCH stable linux-5.10.y v1 5/8] bpf: Introduce MEM_RDONLY flag Puranjay Mohan
2025-06-10 14:44 ` [PATCH stable linux-5.10.y v1 6/8] bpf: Make per_cpu_ptr return rdonly PTR_TO_MEM Puranjay Mohan
2025-06-10 14:44 ` [PATCH stable linux-5.10.y v1 7/8] bpf: Add MEM_RDONLY for helper args that are pointers to rdonly mem Puranjay Mohan
2025-06-10 14:44 ` [PATCH stable linux-5.10.y v1 8/8] bpf/selftests: Test PTR_TO_RDONLY_MEM Puranjay Mohan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250610165605-0d8fabc4a4ee9ec5@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=puranjay@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.