All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Rongguang Wei <clementwei90@163.com>
Cc: netdev@vger.kernel.org, willemdebruijn.kernel@gmail.com,
	jasowangio@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net,
	Rongguang Wei <weirongguang@kylinos.cn>,
	Willem de Bruijn <willemb@google.com>
Subject: Re: [RESEND PATCH net v5 1/2] tun: keep a kernel copy of the socket filter program
Date: Thu, 15 Oct 2026 19:08:40 -0700	[thread overview]
Message-ID: <20261015190840.1f972d69@kernel.org> (raw)
In-Reply-To: <20261012021113.45939-2-clementwei90@163.com>

On Mon, 12 Oct 2026 10:11:12 +0800 Rongguang Wei wrote:
> +/**
> + * sk_attach_filter_kern - attach a classic BPF filter held in kernel memory
> + * @fprog: program to attach, with @fprog->filter pointing at kernel memory
> + * @sk: socket to attach the filter to
> + *
> + * Attach a copy of a classic BPF program that the kernel already holds, the
> + * way sk_attach_filter() does for one that still lives in user space. The
> + * caller must hold the socket lock; SOCK_FILTER_LOCKED is checked here.
> + *
> + * The program is built by bpf_prog_create(), which does not keep an original
> + * copy of the instructions. sk_get_filter() therefore returns -EACCES and
> + * sock_diag leaves the filter out for a socket that uses this helper. A
> + * classic BPF program cannot be duplicated with bpf_prog_copy(), so keeping
> + * the original would cost another allocation and a copy per attach.
> + */
> +int sk_attach_filter_kern(struct sock_fprog_kern *fprog, struct sock *sk)

Warning: net/core/filter.c:1585 No description found for return value of 'sk_attach_filter_kern'
-- 
pw-bot: cr

  reply	other threads:[~2026-10-16  2:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12  2:11 [RESEND PATCH net v5 0/2] tun: fix re-attaching the socket filter Rongguang Wei
2026-10-12  2:11 ` [RESEND PATCH net v5 1/2] tun: keep a kernel copy of the socket filter program Rongguang Wei
2026-10-16  2:08   ` Jakub Kicinski [this message]
2026-10-12  2:11 ` [RESEND PATCH net v5 2/2] selftests: net: add TAP socket filter attach tests Rongguang Wei

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=20261015190840.1f972d69@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=clementwei90@163.com \
    --cc=davem@davemloft.net \
    --cc=jasowangio@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=weirongguang@kylinos.cn \
    --cc=willemb@google.com \
    --cc=willemdebruijn.kernel@gmail.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 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.