netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislav Fomichev <sdf@google.com>
To: Xin Liu <liuxin350@huawei.com>
Cc: daniel@iogearbox.net, andrii@kernel.org, ast@kernel.org,
	 bpf@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	 hsinweih@uci.edu, jakub@cloudflare.com,
	john.fastabend@gmail.com,  kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	 pabeni@redhat.com,
	syzbot+49f6cef45247ff249498@syzkaller.appspotmail.com,
	 syzkaller-bugs@googlegroups.com, yanan@huawei.com,
	wuchangye@huawei.com,  xiesongyang@huawei.com,
	kongweibin2@huawei.com, zhangmingyi5@huawei.com
Subject: Re: [PATCH bpf-next] bpf, sockops: Enhance the return capability of sockops
Date: Thu, 6 Jul 2023 10:43:21 -0700	[thread overview]
Message-ID: <ZKb9ObvvhOaKXJcp@google.com> (raw)
In-Reply-To: <20230706100243.318109-1-liuxin350@huawei.com>

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?

  reply	other threads:[~2023-07-06 17:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 10:02 [PATCH bpf-next] bpf, sockops: Enhance the return capability of sockops Xin Liu
2023-07-06 17:43 ` Stanislav Fomichev [this message]
2023-07-11 16:39 ` Simon Horman

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=ZKb9ObvvhOaKXJcp@google.com \
    --to=sdf@google.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hsinweih@uci.edu \
    --cc=jakub@cloudflare.com \
    --cc=john.fastabend@gmail.com \
    --cc=kongweibin2@huawei.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liuxin350@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=syzbot+49f6cef45247ff249498@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=wuchangye@huawei.com \
    --cc=xiesongyang@huawei.com \
    --cc=yanan@huawei.com \
    --cc=zhangmingyi5@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).