Re: [PATCH bpf-next] bpf, sockops: Enhance the return capability of sockops

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

 



On 07/06, Xin Liu wrote:
> Since commit 2585cd62f098 ("bpf: Only reply field should be writeable"),
> sockops is not allowd to modify the replylong field except replylong[0].
> The reason is that the replylong[1] to replylong[3] field is not used
> at that time.
> 
> But in actual use, we can call `BPF_CGROUP_RUN_PROG_SOCK_OPS` in the
> kernel modules and expect sockops to return some useful data.
> 
> The design comment about bpf_sock_ops::replylong in 
> include/uapi/linux/bpf.h is described as follows:
> 
> ```
>   struct bpf_sock_ops {
> 	__u32 op;
> 	union {
> 		__u32 args[4];		/* Optionally passed to bpf program */
> 		__u32 reply;		/* Returned by bpf program	    */
> 		__u32 replylong[4];	/* Optioznally returned by bpf prog  */
> 	};
>   ...
> ```
> 
> It seems to contradict the purpose for which the field was originally
> designed. Let's remove this restriction.
> 
> Fixes: 2585cd62f098 ("bpf: Only reply field should be writeable")

The commit you reference explicitly says that there is no reason to allow
replylong[1..3] because there is no use for them. Has something changed
since it was added? Any reason to expose those fields?




[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