Re: [PATCH] net: fix search limit handling in skb_find_text()

From: Pablo Neira Ayuso
Date: Thu Jun 18 2015 - 15:56:20 EST


On Tue, Jun 16, 2015 at 03:13:41PM +0300, Roman Khimov wrote:
> Ð ÐÐÑÑÐÐ ÐÑ 16 ÐÑÐÑ 2015 12:48:41 ÐÐÐÑÐÐÐÐÑÐÐÑ Pablo Neira Ayuso ÐÐÐÐÑÐÐ:
[...]
> > But if we change the existing behaviour, users may be relying on it
> > and we'll get things broken for them. Someone else will come later one
> > with another patch to say: "hey, --to used to be inclusive but this is
> > not the case anymore and it's breaking my setup".
>
> I do understand your concerns, but fixing it this way would require changing
> skb_seq_read() and basicaly would propagate "'to' offset included" semantics
> (which seems a bit strange for programmers, IMO) further. And initially I
> thought that changing skb_seq_read() would be more intrusive, although looking
> at all this now it looks like the only real user of upper_offset field in
> ts_config struct is skb_find_text(), because other invocations of
> skb_seq_read() from drivers/scsi/libiscsi_tcp.c and net/batman-adv/main.c use
> skb->len as an upper limit.
>
> > > em_text_match() in net/sched/em_text.c is also suspicious.
> >
> > Please, elaborate.
>
> The way it constructs 'to' offset, I think it doesn't expect something to
> match at 'to'. Although I might be wrong here.

Could you send a patch that resolves the inconsistency for programmers
while leaving the userspace exposed behaviour through xt_string and
em_string intact? Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/