All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Sowden <jeremy@azazel.net>
To: Jan Engelhardt <jengelh@inai.de>
Cc: ValdikSS <iam@valdikss.org.ru>, netfilter-devel@vger.kernel.org
Subject: Re: xtables-addons: ipp2p does not block TCP traffic with nonlinear skb
Date: Wed, 31 May 2023 16:01:02 +0100	[thread overview]
Message-ID: <20230531150102.GA1355804@azazel.net> (raw)
In-Reply-To: <7rr4q976-5qn6-382r-0pp-66rq492r9376@vanv.qr>

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

On 2023-05-31, at 11:41:07 +0200, Jan Engelhardt wrote:
> On Wednesday 2023-05-31 08:42, ValdikSS wrote:
> > However, it's not getting processed due to nonlinear skb:
> >
> >> static bool
> >> ipp2p_mt(const struct sk_buff *skb, struct xt_action_param *par)
> >>  /* make sure that skb is linear */
> >>  if (skb_is_nonlinear(skb)) {
> >>   if (info->debug)
> >>   	printk("IPP2P.match: nonlinear skb found\n");
> >>  	return 0;
> >>  }
> 
> It should be possible to just take the code from xt_ECHO and call
> 
> if (skb_linearize(skb) < 0)
> 	return false;
> 
> However, none of the xtables matches in the Linux kernel do this
> linearization, at least not that I can see directly.

They use `skb_header_pointer` instead, I think, which handles the
linearization behind the scenes.  I'll send a patch.

> Or xt_string's call to skb_find_text is magic..

J.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-05-31 15:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  6:42 xtables-addons: ipp2p does not block TCP traffic with nonlinear skb ValdikSS
2023-05-31  9:41 ` Jan Engelhardt
2023-05-31 15:01   ` Jeremy Sowden [this message]
2023-05-31 15:15     ` Jan Engelhardt
2023-06-01 19:01   ` Pablo Neira Ayuso

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=20230531150102.GA1355804@azazel.net \
    --to=jeremy@azazel.net \
    --cc=iam@valdikss.org.ru \
    --cc=jengelh@inai.de \
    --cc=netfilter-devel@vger.kernel.org \
    /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.