From: "cron2 (Code Review)" Date: Wed, 11 Dec 2024 17:13:20 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="UiX3XtHaU4s="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: forward: Fix potential unaligned access in drop_if_recursive_routing List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --UiX3XtHaU4s= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld, plaisthos. cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/ope= nvpn/+/827?usp=3Demail ) Change subject: forward: Fix potential unaligned access in drop_if_recursiv= e_routing ...................................................................... Patch Set 3: Code-Review+2 (1 comment) Patchset: PS3: For the record: long discussion on the underlying problem - Linux has a dif= ferent `IN6_ARE_ADDR_EQUAL()` macro than "the rest of the world" - doing 4x= 32bit compares, instead of a `memcmp()` underneath. Which is faster if al= igned, and bombs if not. We could make the header aligned by misaligning the underlying `buf` for th= e TAP case (14/18 byte ethernet header...) but decided that this would be a= serious undertaking, possibly needing new buffers to get the crypto stuff = aligned, and there be dragons. So, just use `memcmp()` for both v4 and v6, on the base pointer, which appe= ases clang. If the compiler wants to turn this into machine code that does= 32 or 64 bit compares, it can :-) -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/827?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: I74a9eec4954f3f9d208792b6b34357571f76ae4c Gerrit-Change-Number: 827 Gerrit-PatchSet: 3 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-Attention: flichtenheld Gerrit-Comment-Date: Wed, 11 Dec 2024 17:13:20 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment --UiX3XtHaU4s= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: flichtenheld, plaisthos.

Patch set 3:Code-Review +2=

Vi= ew Change

1 comment:

  • Patchset:

    • Patch Set #3:

      For the record: long discussion on the underly= ing problem - Linux has a different `IN6_ARE_ADDR_EQUAL()` macro than "= ;the rest of the world" - doing 4x 32bit compares, instead of a `memcm= p()` underneath. Which is faster if aligned, and bombs if not.

      We could make the header= aligned by misaligning the underlying `buf` for the TAP case (14/18 byte e= thernet header...) but decided that this would be a serious undertaking, po= ssibly needing new buffers to get the crypto stuff aligned, and there be dr= agons.

      So, ju= st use `memcmp()` for both v4 and v6, on the base pointer, which appeases c= lang. If the compiler wants to turn this into machine code that does 32 or= 64 bit compares, it can :-)

To view, visit change 827= . To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I74a9eec4954f3f9d208792b6b34= 357571f76ae4c
Gerrit-Change-Number: 827
Gerrit-PatchSet: 3
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
Gerrit-Comment-Date: Wed, 11 Dec 2024 17:13:20= +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
--UiX3XtHaU4s=--