Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1436429

Re: [PATCH] netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq

From Liping Zhang <zlpnobody@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq
Date 2016-07-04 13:50 +0200
Message-ID <rRaxY-55H-11@gated-at.bofh.it> (permalink)
References <rQ3fc-4Yz-33@gated-at.bofh.it> <rR4Vz-1HH-3@gated-at.bofh.it> <rR5oB-26S-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


2016-07-04 14:14 GMT+08:00 Christophe Leroy <christophe.leroy@c-s.fr>:
>> I think there is no need to convert simple_strtoul to kstrtouint, add
>> a further check seems better?
>> Like this:
>>  -       if (!cseq) {
>> +       if (!cseq && *(*dptr + matchoff) != '0') {
>>
>
> And what about an invalid CSeq that would look like CSeq: 0abzk852 ?
> Should we check it is 0 + space instead ?

In this case, i.e. some stupid sip clients set CSeq to "0abzk852",
your patch will also fail to detect this "error".

Because for "Cseq", int (*match_len)(...) point to digits_len(see
struct sip_header ct_sip_hdrs definition).
So in this case match_len will just be setted to ONE (not
sizeof("0abzk852")-1), then cseq will be parsed
as 0 by  kstrtouint, not as an error.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq Christophe Leroy <christophe.leroy@c-s.fr> - 2016-07-01 11:50 +0200
  Re: [PATCH] netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq Liping Zhang <zlpnobody@gmail.com> - 2016-07-04 07:50 +0200
    Re: [PATCH] netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq Christophe Leroy <christophe.leroy@c-s.fr> - 2016-07-04 08:20 +0200
      Re: [PATCH] netfilter: nf_conntrack_sip: CSeq 0 is a valid CSeq Liping Zhang <zlpnobody@gmail.com> - 2016-07-04 13:50 +0200

csiph-web