From: "d12fk (Code Review)" Date: Tue, 9 Jan 2024 13:16:20 +0000 In-Reply-To: References: Reply-To: heiko@...515..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641..., gert@...1296... Message-ID: <9d5bc3f56a72e05ec857190a04354375b8700fa1-EmailReviewComments-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="k7SRd2UIQZM="; charset=UTF-8 Subject: [Openvpn-devel] [L] Change in openvpn[master]: Windows: enforce 'block-local' with WFP filters List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: flichtenheld , cron2 , plaisthos , openvpn-devel --k7SRd2UIQZM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: cron2, flichtenheld, plaisthos. d12fk has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/489?usp=3Demail ) Change subject: Windows: enforce 'block-local' with WFP filters ...................................................................... Patch Set 1: (10 comments) File doc/man-sections/vpn-network-options.rst: http://gerrit.openvpn.net/c/openvpn/+/489/comment/616966e3_6506d21f : PS1, Line 357: Push this flag to defend against the TunnelCrack attac= ks. > Should explain a bit more what this protects against. [=E2=80=A6] Agree not to explain TunnelCrack in the openvpn man page, but then referenc= es are not much of a thing in roff either. Could you elaborate what you hav= e in mind? The technicalities are explained before the concluding sentence,= so if you have a clue about TunnnelCrack things should be clear enough. File src/openvpn/init.c: http://gerrit.openvpn.net/c/openvpn/+/489/comment/b47799d4_dca0b2c0 : PS1, Line 1971: /* Fortify 'redirect-gateway block-local' with fire= wall rules? */ > Since this hunk and the previous are completely identical I would move th= em to a separate function. [=E2=80=A6] I think there's even more duplicate code before. I'll take a look and submi= t a separate commit if it is not tightly related to wfp only. File src/openvpn/route.h: http://gerrit.openvpn.net/c/openvpn/+/489/comment/0c835951_e7364760 : PS1, Line 248: * is connected. This definatly returns false when not redir= ecting the gateway > Typo "definatly" Done File src/openvpn/route.c: http://gerrit.openvpn.net/c/openvpn/+/489/comment/eb7787ef_be0c1c5c : PS1, Line 78: static bool add_route(struct route_ipv4 *r, const struct tunt= ap *tt, unsigned int flags, > this breaks compilation on a zillion of platforms that want to call add_r= oute() from tun. [=E2=80=A6] Right, failed to spot this. The build results speak for themselves. =3D/ http://gerrit.openvpn.net/c/openvpn/+/489/comment/0e347637_c3fa5a5a : PS1, Line 612: size_t i; > no reason to leave that on its own line Done File src/openvpn/wfp_block.c: http://gerrit.openvpn.net/c/openvpn/+/489/comment/97c5a316_ea67f28e : PS1, Line 167: * Block outgoing port 53 traffic except for > "port 53" needs to be changed to reflect the new functionality Done http://gerrit.openvpn.net/c/openvpn/+/489/comment/ff62cf3d_89d511ff : PS1, Line 197: FWPM_FILTER_CONDITION0 Condition[2]; > Why remove the "=3D {0}" here? because the filters are zeroed right below, and than copied into [0] and/or= [1] below as needed, so there's no uninitialized memory. http://gerrit.openvpn.net/c/openvpn/+/489/comment/662c3688_6dc87eea : PS1, Line 294: /* Third filter. Block IPv4 to port 53 or all besided lo= opback. */ > "besides"? Or maybe "except"? Done http://gerrit.openvpn.net/c/openvpn/+/489/comment/af60e388_d7cb7c20 : PS1, Line 303: /* Forth filter. Block IPv6 to port 53 or all besides lo= opback */ > "Fourth" Done File src/openvpn/win32.c: http://gerrit.openvpn.net/c/openvpn/+/489/comment/bdfe473f_2369c40d : PS1, Line 1225: if (ret =3D=3D false) > Simplify to "!win_get_exe_path(openvpnpath, _countof(openvpnpath))" We need to set ret as return value anyway, so doing it before the if is mor= e readable IMHO compared to cramming the function call between the parenthe= ses. -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/489?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ic9bf797bfc7e2d471998a84cb0f071db3e4832ba Gerrit-Change-Number: 489 Gerrit-PatchSet: 1 Gerrit-Owner: d12fk Gerrit-Reviewer: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: cron2 Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: cron2 Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Tue, 09 Jan 2024 13:16:20 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: cron2 Comment-In-Reply-To: flichtenheld Gerrit-MessageType: comment --k7SRd2UIQZM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: cron2, flichtenheld, plaisthos. <= /p>

View C= hange

10 comments:

  • File doc/man-sections/vpn-network-= options.rst:

    • Patch = Set #1, Line 357: = Push this flag to defend against the TunnelCrack attacks.

      Should explain a bit more what this protects against. [=E2=80=A6]

      Agr= ee not to explain TunnelCrack in the openvpn man page, but then references = are not much of a thing in roff either. Could you elaborate what you have i= n mind? The technicalities are explained before the concluding sentence, so= if you have a clue about TunnnelCrack things should be clear enough.

  • File src/openvpn/init.= c:

    • Patch Set #1, Li= ne 1971: /* For= tify 'redirect-gateway block-local' with firewall rules? */<= /p>

      Since this hunk and the previous are completely identical I = would move them to a separate function. [=E2=80=A6]

      I think there's eve= n more duplicate code before. I'll take a look and submit a separate co= mmit if it is not tightly related to wfp only.

  • File src/openvpn/route.h:

    • =

      Patch Set #1, Line 248: * is connected. This definatly retu= rns false when not redirecting the gateway

      Typo &qu= ot;definatly"

      Done

  • File src/openvpn/route.c:

    • Patch Set #1, Line 78: static bool add_route(struct route_ipv4 *r, const struct tunt= ap *tt, unsigned int flags,

      this breaks compilation o= n a zillion of platforms that want to call add_route() from tun. [=E2=80=A6= ]

      Patch Set #1, Line 612: size_t i;

      no reason to leave th= at on its own line

      Done

  • File src/openvpn/wfp_block.c:

    • Patch Set #1, Line 167: * Block outgoing port 53 traffic except for

      <= p>
      "port 53" needs to be changed to reflect the new funct= ionality

      Done

    • Patch Set #1, Line 197: FWPM_FILTER_CONDITION0 Condition[2];

      Why remove the "=3D {0}" here?

      because the fi= lters are zeroed right below, and than copied into [0] and/or [1] below as = needed, so there's no uninitialized memory.

    • Patch Set = #1, Line 294: /* Th= ird filter. Block IPv4 to port 53 or all besided loopback. */

      =

      "besides"? Or maybe "except"?

      =

      Done

    • Patch Set #1, Line 303: /* Forth filter. Block IPv6 to port 53 or all besides loopback *= /

      "Fourth"

      Done

  • File src/openvpn/win32.c:

    • =

      Patch Set #1, Line 1225: if (ret =3D=3D false)

      Simplify to "!win_get_exe_path(openvpnpath, _countof(open= vpnpath))"

      We need to set ret as return value anyway, so doing it befo= re the if is more readable IMHO compared to cramming the function call betw= een the parentheses.

To view, visit change 489. To uns= ubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ic9bf797bfc7e2d471998a84cb0f= 071db3e4832ba
Gerrit-Change-Number: 489
Gerrit-PatchSet: 1
Gerrit-Owner: d12fk <heiko@...515...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: cron2 <gert@...1296...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: cron2 <gert@...1296...>= ;
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Tue, 09 Jan 2024 13:16:20= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <gert@...1296...= >
Comment-In-Reply-To: flichtenheld <frank@...1186...= .2641...>
Gerrit-MessageType: comment
--k7SRd2UIQZM=--