Re: [PATCH bpf-next v3 1/3] x86/cfi,bpf: Add a stub function for get_info of struct tcp_congestion_ops.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2/20/24 09:38, Alexei Starovoitov wrote:
On Fri, Feb 16, 2024 at 11:34 AM <thinker.li@xxxxxxxxx> wrote:

From: Kui-Feng Lee <thinker.li@xxxxxxxxx>

struct tcp_congestion_ops is missing a stub function for get_info.  This is
required for checking the consistency of cfi_stubs of struct_ops.

Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Signed-off-by: Kui-Feng Lee <thinker.li@xxxxxxxxx>
---
  net/ipv4/bpf_tcp_ca.c | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c
index 7f518ea5f4ac..6ab5d9c36416 100644
--- a/net/ipv4/bpf_tcp_ca.c
+++ b/net/ipv4/bpf_tcp_ca.c
@@ -321,6 +321,12 @@ static u32 bpf_tcp_ca_sndbuf_expand(struct sock *sk)
         return 0;
  }

+static size_t bpf_tcp_ca_get_info(struct sock *sk, u32 ext, int *attr,
+                                 union tcp_cc_info *info)
+{
+       return 0;
+}
+
  static void __bpf_tcp_ca_init(struct sock *sk)
  {
  }
@@ -340,6 +346,7 @@ static struct tcp_congestion_ops __bpf_ops_tcp_congestion_ops = {
         .cong_control = bpf_tcp_ca_cong_control,
         .undo_cwnd = bpf_tcp_ca_undo_cwnd,
         .sndbuf_expand = bpf_tcp_ca_sndbuf_expand,
+       .get_info = bpf_tcp_ca_get_info,

No. It was explicitly skipped.
The plan is to use NULL in cfi_stubs to remove
static u32 unsupported_ops[] = {
         offsetof(struct tcp_congestion_ops, get_info),
};
and manual check of such fields in is_unsupported().


Ok! That means I have to check the result of st_ops->check() to skip
unsupported ops.


NULL is cfi_stubs will be such an indication.

pw-bot: cr




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux