NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/55179: ipfilter ip_state.c's problem
Thank you.
Please close this PR.
And please pull-up to 9 branch.
--
Kouichi Hashikawa <hashikaw%mail.ru@localhost>
> 2020/04/19 2:05、Christos Zoulas <christos%zoulas.com@localhost>のメール:
>
> The following reply was made to PR kern/55179; it has been noted by GNATS.
>
> From: Christos Zoulas <christos%zoulas.com@localhost>
> To: Kouichi Hashikawa <hashikaw%mail.ru@localhost>
> Cc: gnats-bugs%netbsd.org@localhost,
> kern-bug-people%netbsd.org@localhost,
> gnats-admin%netbsd.org@localhost,
> netbsd-bugs%netbsd.org@localhost
> Subject: Re: kern/55179: ipfilter ip_state.c's problem
> Date: Sat, 18 Apr 2020 13:03:47 -0400
>
> --Apple-Mail=_E0EC186C-1253-4CDE-874B-32FE8B433C4D
> Content-Type: multipart/alternative;
> boundary="Apple-Mail=_206AB399-EB41-4E53-A2E5-B7F864DF6CE6"
>
>
> --Apple-Mail=_206AB399-EB41-4E53-A2E5-B7F864DF6CE6
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/plain;
> charset=utf-8
>
> I think this is correct: sp, dp are in network byte order and so is:
> % fgrep is_sport\ =3D *.c
> ip_state.c: is->is_sport =3D htons(fin->fin_data[0]);
> ip_state.c: is->is_sport =3D htons(fin->fin_data[0]);
> ip_state.c: is->is_sport =3D sp;
> ip_state.c: is->is_sport =3D dp;
>
> I fixed the inconsistency the the tcp !=3D NULL case, but that's =
> cosmetic.
>
> christos
>
>
>
>
>>> On Apr 17, 2020, at 8:04 PM, Kouichi Hashikawa <hashikaw%mail.ru@localhost> =
>> wrote:
>> =20
>> =20
>> =20
>> Sorry, the reason I think this is a problem, comparing same value =
> (is->is_sport or is->dport) to
>> =20
>> sp (htons) or dp (ntohs).
>> =20
>> =20
>> =20
>> --------
>> =20
>> if (tcp !=3D NULL) {
>> sp =3D htons(fin->fin_sport);
>> dp =3D ntohs(fin->fin_dport);
>> }
>> =20
>> =E2=80=A6
>> =20
>> /*
>> * Match addresses and ports.
>> */
>> if (rev =3D=3D 0) {
>> if ((IP6_EQ(&is->is_dst, dst) || (flags & SI_W_DADDR)) =
> &&
>> (IP6_EQ(&is->is_src, src) || (flags & =
> SI_W_SADDR))) {
>> =20
>> if (tcp) {
>> if ((sp =3D=3D is->is_sport || flags & =
> SI_W_SPORT) <-------
>> &&
>> (dp =3D=3D is->is_dport || flags & =
> SI_W_DPORT)) <-------
>> ret =3D 1;
>> =20
>> } else {
>> ret =3D 1;
>> }
>> }
>> } else {
>> if ((IP6_EQ(&is->is_dst, src) || (flags & SI_W_DADDR)) =
> &&
>> (IP6_EQ(&is->is_src, dst) || (flags & =
> SI_W_SADDR))) {
>> if (tcp) {
>> if ((dp =3D=3D is->is_sport || flags & =
> SI_W_SPORT) <-------
>> &&
>> (sp =3D=3D is->is_dport || flags & =
> SI_W_DPORT)) <-------
>> ret =3D 1;
>> } else {
>> ret =3D 1;
>> }
>> }
>> }
>> =20
>> --------
>> =20
>> =20
>> =20
>> =20
>> =20
>> Wednesday, April 15, 2020 7:20 PM +09:00 from gnats-admin%netbsd.org@localhost:
>> Thank you very much for your problem report.
>> It has the internal identification `kern/55179'.
>> The individual assigned to look at your
>> report is: kern-bug-people.
>> =20
>> =20
>>> Category: kern
>>> Responsible: kern-bug-people
>>> Synopsis: ipfilter ip_state.c's problem
>>> Arrival-Date: Wed Apr 15 10:20:00 +0000 2020
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> --
>> Kouichi Hashikawa <hashikaw%mail.ru@localhost>
>> =20
>> =20
>> =20
>> =20
>> =20
>> =20
>> <sanitizer.log>
>
>
> --Apple-Mail=_206AB399-EB41-4E53-A2E5-B7F864DF6CE6
> Content-Transfer-Encoding: quoted-printable
> Content-Type: text/html;
> charset=utf-8
>
> <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
> charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
> -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D"">I =
> think this is correct: sp, dp are in network byte order and so is:<div =
> class=3D"">% fgrep is_sport\ =3D *.c</div><div class=3D"">ip_state.c: =
> is->is_sport =3D =
> htons(fin->fin_data[0]);<div class=3D"">ip_state.c: =
> is->is_sport =3D =
> htons(fin->fin_data[0]);</div><div class=3D"">ip_state.c: =
> =
> is->is_sport =3D sp;</div><div =
> class=3D"">ip_state.c: =
> is->is_sport =3D =
> dp;</div><div class=3D""><br class=3D""></div><div class=3D"">I fixed =
> the inconsistency the the tcp !=3D NULL case, but that's =
> cosmetic.</div><div class=3D""><br class=3D""></div><div =
> class=3D"">christos</div><div class=3D""><br class=3D""></div><div =
> class=3D""><br class=3D""></div><div class=3D""><br =
> class=3D""></div><div><br class=3D""><blockquote type=3D"cite" =
> class=3D""><div class=3D"">On Apr 17, 2020, at 8:04 PM, Kouichi =
> Hashikawa <<a href=3D"mailto:hashikaw%mail.ru@localhost" =
> class=3D"">hashikaw%mail.ru@localhost</a>> wrote:</div><br =
> class=3D"Apple-interchange-newline"><div class=3D"">
> <div class=3D""><p class=3D""><defanged_div =
> class=3D""></defanged_div></p><p class=3D""><defanged_div =
> class=3D""> </defanged_div></p><defanged_div class=3D""><p =
> class=3D""><defanged_div class=3D"">Sorry, the reason I think this is a =
> problem, comparing same value (is->is_sport or is->dport) =
> to</defanged_div></p><defanged_div class=3D""><p class=3D""><defanged_div =
> class=3D"">sp (htons) or dp (ntohs).</defanged_div></p><defanged_div =
> class=3D""><p class=3D""><defanged_div =
> class=3D""> </defanged_div></p><defanged_div class=3D""><p =
> class=3D""><defanged_div =
> class=3D"">--------</defanged_div></p><defanged_div class=3D""><p =
> class=3D""><defanged_div class=3D""></defanged_div></p><p =
> class=3D""><defanged_div =
> class=3D""> if (tcp !=3D NULL) =
> {<br =
> class=3D""> &nb=
> sp; sp =3D htons(fin->fin_sport);<br =
> class=3D""> &nb=
> sp; dp =3D ntohs(fin->fin_dport);<br =
> class=3D""> =
> }</defanged_div></p><defanged_div class=3D""><p class=3D""><defanged_div =
> class=3D"">=E2=80=A6</defanged_div></p><defanged_div class=3D""><p =
> class=3D""><defanged_div class=3D""></defanged_div></p><p =
> class=3D""><defanged_div =
> class=3D""> /*<br =
> class=3D""> * Match =
> addresses and ports.<br =
> class=3D""> */<br =
> class=3D""> if (rev =3D=3D 0) =
> {<br =
> class=3D""> &nb=
> sp; if ((IP6_EQ(&is->is_dst, dst) || =
> (flags & SI_W_DADDR)) &&<br =
> class=3D""> &nb=
> sp; =
> (IP6_EQ(&is->is_src, src) || (flags & SI_W_SADDR))) =
> {</defanged_div></p><defanged_div class=3D""><p class=3D""><defanged_div =
> class=3D""></defanged_div></p><p class=3D""><defanged_div =
> class=3D""> &nb=
> sp;  =
> ; if (tcp) {<br =
> class=3D""> &nb=
> sp;  =
> ; if ((sp =3D=3D =
> is->is_sport || flags & SI_W_SPORT) =
> <-------<br =
> class=3D""> &nb=
> sp;  =
> ; =
> &&<br =
> class=3D""> &nb=
> sp;  =
> ; =
> (dp =3D=3D is->is_dport || flags & SI_W_DPORT)) =
> <-------<br =
> class=3D""> &nb=
> sp;  =
> ; &=
> nbsp; ret =3D 1;</defanged_div></p><defanged_div =
> class=3D""><p class=3D""><defanged_div class=3D""></defanged_div></p><p =
> class=3D""><defanged_div =
> class=3D""> &nb=
> sp;  =
> ; } else {<br =
> class=3D""> &nb=
> sp;  =
> ; ret =3D 1;<br =
> class=3D""> &nb=
> sp;  =
> ; }<br =
> class=3D""> &nb=
> sp; }<br =
> class=3D""> } else {<br =
> class=3D""> &nb=
> sp; if ((IP6_EQ(&is->is_dst, src) || =
> (flags & SI_W_DADDR)) &&<br =
> class=3D""> &nb=
> sp; =
> (IP6_EQ(&is->is_src, dst) || (flags & SI_W_SADDR))) {<br =
> class=3D""> &nb=
> sp;  =
> ; if (tcp) {<br =
> class=3D""> &nb=
> sp;  =
> ; if ((dp =3D=3D =
> is->is_sport || flags & SI_W_SPORT) =
> <-------<br =
> class=3D""> &nb=
> sp;  =
> ; =
> &&<br =
> class=3D""> &nb=
> sp;  =
> ; =
> (sp =3D=3D is->is_dport || flags & SI_W_DPORT)) =
> <-------<br =
> class=3D""> &nb=
> sp;  =
> ; &=
> nbsp; ret =3D 1;<br =
> class=3D""> &nb=
> sp;  =
> ; } else {<br =
> class=3D""> &nb=
> sp;  =
> ; ret =3D 1;<br =
> class=3D""> &nb=
> sp;  =
> ; }<br =
> class=3D""> &nb=
> sp; }<br =
> class=3D""> =
> }</defanged_div></p><defanged_div class=3D""><p class=3D""><defanged_div =
> class=3D""> --------</defanged_div></p><defanged_div class=3D""><div =
> class=3D""><br class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""><div class=3D""><br =
> class=3D"webkit-block-placeholder"></div><defanged_div class=3D""><div =
> class=3D""><br class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""><div class=3D""><br =
> class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""><blockquote data-darkreader-inline-border-left=3D"" =
> defanged_style=3D"border-left: 1px solid rgb(8, 87, 166); margin: 10px; =
> padding: 0px 0px 0px 10px; --darkreader-inline-border-left:#0a6cce;" =
> class=3D"">Wednesday, April 15, 2020 7:20 PM +09:00 from <a =
> href=3D"mailto:gnats-admin%netbsd.org@localhost" =
> class=3D"">gnats-admin%netbsd.org@localhost</a>:<br class=3D""><p =
> class=3D""><defanged_div id=3D"" class=3D""></defanged_div></p><p =
> class=3D""><defanged_div class=3D"js-helper =
> js-readmsg-msg"><defanged_style type=3D"text/css" =
> class=3D""></defanged_style><defanged_style class=3D"darkreader =
> darkreader--sync" media=3D"screen" =
> type=3D"text/css"></defanged_style></defanged_div></p><p =
> class=3D""><defanged_div class=3D""></defanged_div></p><p =
> class=3D""><defanged_div id=3D"style_15869460051008274250_BODY" =
> class=3D"">Thank you very much for your problem report.<br class=3D"">It =
> has the internal identification `kern/55179'.<br class=3D"">The =
> individual assigned to look at your<br class=3D"">report is: =
> kern-bug-people.<br class=3D""> </defanged_div></p><p =
> class=3D""><defanged_div class=3D"mail-quote-collapse">>Category: =
> kern<br class=3D"">>Responsible: kern-bug-people<br =
> class=3D"">>Synopsis: ipfilter ip_state.c's problem<br =
> class=3D"">>Arrival-Date: Wed Apr 15 10:20:00 <defanged_span =
> class=3D"js-phone-number">+0000 =
> 2020</defanged_span></defanged_div></p><defanged_div class=3D""><div =
> class=3D""><br class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""><div class=3D""><br =
> class=3D"webkit-block-placeholder"></div><defanged_div class=3D""><div =
> class=3D""><br class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""><div class=3D""><br =
> class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""></defanged_div></defanged_div></defanged_div></defanged_div></d=
> efanged_div></blockquote><p class=3D""><defanged_div =
> class=3D""> </defanged_div></p><defanged_div class=3D""><p =
> class=3D""><defanged_div data-signature-widget=3D"container" =
> class=3D""></defanged_div></p><p class=3D""><defanged_div =
> data-signature-widget=3D"content" class=3D""></defanged_div></p><p =
> class=3D""><defanged_div class=3D"">--<br class=3D"">Kouichi Hashikawa =
> <<a href=3D"mailto:hashikaw%mail.ru@localhost" =
> class=3D"">hashikaw%mail.ru@localhost</a>></defanged_div></p><defanged_div =
> class=3D""><div class=3D""><br =
> class=3D"webkit-block-placeholder"></div><defanged_div class=3D""><div =
> class=3D""><br class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""><p class=3D""><defanged_div =
> class=3D""> </defanged_div></p><defanged_div class=3D""><div =
> class=3D""><br class=3D"webkit-block-placeholder"></div><defanged_div =
> class=3D""></defanged_div></defanged_div></defanged_div></defanged_div></d=
> efanged_div></defanged_div></defanged_div></defanged_div></defanged_div></=
> defanged_div></defanged_div></defanged_div></defanged_div></defanged_div><=
> /defanged_div></defanged_div></defanged_div></defanged_div></defanged_div>=
> </defanged_div></defanged_div></div>
> <span =
> id=3D"cid:05CE5A54-6742-4D5F-90FD-A5B537FA78BF@astron.com"><sanitizer.l=
> og></span></div></blockquote></div><br class=3D""></div></body></html>=
>
> --Apple-Mail=_206AB399-EB41-4E53-A2E5-B7F864DF6CE6--
>
> --Apple-Mail=_E0EC186C-1253-4CDE-874B-32FE8B433C4D
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
> filename=signature.asc
> Content-Type: application/pgp-signature;
> name=signature.asc
> Content-Description: Message signed with OpenPGP
>
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
>
> iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCXpsy8wAKCRBxESqxbLM7
> OsqFAJ9ufExhBibWE0rzTP9F2EDhT/BSNwCeIT6SUdjY9eCKYI/YfIMjuuyUExY=
> =vfYB
> -----END PGP SIGNATURE-----
>
> --Apple-Mail=_E0EC186C-1253-4CDE-874B-32FE8B433C4D--
>
Home |
Main Index |
Thread Index |
Old Index