Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0aa0151c authored by Chenbo Feng's avatar Chenbo Feng
Browse files

ANDROID: Fix missing uapi headers



Update the missing bpf helper function name in bpf_func_id to keep the
uapi header consistent with upstream uapi header because we need the
new added bpf helper function bpf get_socket_cookie and get_socket_uid.
The patch related to those headers are not backetported since they are
not related and backport them will bring in extra confilict.

Signed-off-by: default avatarChenbo Feng <fengc@google.com>
Bug: 30950746
Change-Id: I2b5fd03799ac5f2e3243ab11a1bccb932f06c312
parent cde30d1a
Loading
Loading
Loading
Loading
+43 −0
Original line number Diff line number Diff line
@@ -443,6 +443,49 @@ enum bpf_func_id {
	 */
	BPF_FUNC_set_hash_invalid,

	/**
	 * int bpf_get_numa_node_id()
	 *     Return: Id of current NUMA node.
	 */
	BPF_FUNC_get_numa_node_id,

	/**
	 * int bpf_skb_change_head()
	 *     Grows headroom of skb and adjusts MAC header offset accordingly.
	 *     Will extends/reallocae as required automatically.
	 *     May change skb data pointer and will thus invalidate any check
	 *     performed for direct packet access.
	 *     @skb: pointer to skb
	 *     @len: length of header to be pushed in front
	 *     @flags: Flags (unused for now)
	 *     Return: 0 on success or negative error
	 */
	BPF_FUNC_skb_change_head,

	/**
	 * int bpf_xdp_adjust_head(xdp_md, delta)
	 *     Adjust the xdp_md.data by delta
	 *     @xdp_md: pointer to xdp_md
	 *     @delta: An positive/negative integer to be added to xdp_md.data
	 *     Return: 0 on success or negative on error
	 */
	BPF_FUNC_xdp_adjust_head,

	/**
	 * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
	 *     Copy a NUL terminated string from unsafe address. In case the string
	 *     length is smaller than size, the target is not padded with further NUL
	 *     bytes. In case the string length is larger than size, just count-1
	 *     bytes are copied and the last byte is set to NUL.
	 *     @dst: destination address
	 *     @size: maximum number of bytes to copy, including the trailing NUL
	 *     @unsafe_ptr: unsafe address
	 *     Return:
	 *       > 0 length of the string including the trailing NUL on success
	 *       < 0 error
	 */
	BPF_FUNC_probe_read_str,

	__BPF_FUNC_MAX_ID,
};

+81 −0
Original line number Diff line number Diff line
@@ -375,6 +375,87 @@ enum bpf_func_id {
	 */
	BPF_FUNC_probe_write_user,

	/**
	 * int bpf_skb_change_tail(skb, len, flags)
	 *     The helper will resize the skb to the given new size, to be used f.e.
	 *     with control messages.
	 *     @skb: pointer to skb
	 *     @len: new skb length
	 *     @flags: reserved
	 *     Return: 0 on success or negative error
	 */
	BPF_FUNC_skb_change_tail,

	/**
	 * int bpf_skb_pull_data(skb, len)
	 *     The helper will pull in non-linear data in case the skb is non-linear
	 *     and not all of len are part of the linear section. Only needed for
	 *     read/write with direct packet access.
	 *     @skb: pointer to skb
	 *     @len: len to make read/writeable
	 *     Return: 0 on success or negative error
	 */
	BPF_FUNC_skb_pull_data,

	/**
	 * s64 bpf_csum_update(skb, csum)
	 *     Adds csum into skb->csum in case of CHECKSUM_COMPLETE.
	 *     @skb: pointer to skb
	 *     @csum: csum to add
	 *     Return: csum on success or negative error
	 */
	BPF_FUNC_csum_update,

	/**
	 * void bpf_set_hash_invalid(skb)
	 *     Invalidate current skb->hash.
	 *     @skb: pointer to skb
	 */
	BPF_FUNC_set_hash_invalid,

	/**
	 * int bpf_get_numa_node_id()
	 *     Return: Id of current NUMA node.
	 */
	BPF_FUNC_get_numa_node_id,

	/**
	 * int bpf_skb_change_head()
	 *     Grows headroom of skb and adjusts MAC header offset accordingly.
	 *     Will extends/reallocae as required automatically.
	 *     May change skb data pointer and will thus invalidate any check
	 *     performed for direct packet access.
	 *     @skb: pointer to skb
	 *     @len: length of header to be pushed in front
	 *     @flags: Flags (unused for now)
	 *     Return: 0 on success or negative error
	 */
	BPF_FUNC_skb_change_head,

	/**
	 * int bpf_xdp_adjust_head(xdp_md, delta)
	 *     Adjust the xdp_md.data by delta
	 *     @xdp_md: pointer to xdp_md
	 *     @delta: An positive/negative integer to be added to xdp_md.data
	 *     Return: 0 on success or negative on error
	 */
	BPF_FUNC_xdp_adjust_head,

	/**
	 * int bpf_probe_read_str(void *dst, int size, const void *unsafe_ptr)
	 *     Copy a NUL terminated string from unsafe address. In case the string
	 *     length is smaller than size, the target is not padded with further NUL
	 *     bytes. In case the string length is larger than size, just count-1
	 *     bytes are copied and the last byte is set to NUL.
	 *     @dst: destination address
	 *     @size: maximum number of bytes to copy, including the trailing NUL
	 *     @unsafe_ptr: unsafe address
	 *     Return:
	 *       > 0 length of the string including the trailing NUL on success
	 *       < 0 error
	 */
	BPF_FUNC_probe_read_str,

	__BPF_FUNC_MAX_ID,
};