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