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

From: Pablo Neira Ayuso <[email-masked]>
Date: Thu, 18 Jun 2015 22:01:31 +0200

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.