[PATCH 0/3] Fix ARP table parsing over netlink messages

Martin Kletzander posted 3 patches 3 months, 1 week ago
src/util/virarptable.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
[PATCH 0/3] Fix ARP table parsing over netlink messages
Posted by Martin Kletzander 3 months, 1 week ago
Somehow it happened that some kernels (I noticed this with 6.10.0 and 6.10.2 on
various machines) started sending NLMSG_DONE message (as they probably should've
even before), but our check for it could've never worked and now `virsh
domifaddr --source arp` sometimes fails with "wrong nlmsg len".  So I set out on
a quest to tame the netlink beast and though fierceful debugging and...  Oh, I
forgot, nobody reads cover letters.  Never mind.

Martin Kletzander (3):
  virarptable: Properly calculate rtattr length
  virarptable: Fix check for message length
  virarptable: End parsing earlier in case of NLMSG_DONE

 src/util/virarptable.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

-- 
2.46.0
Re: [PATCH 0/3] Fix ARP table parsing over netlink messages
Posted by Laine Stump 3 months, 1 week ago
On 8/16/24 8:45 AM, Martin Kletzander wrote:
> Somehow it happened that some kernels (I noticed this with 6.10.0 and 6.10.2 on
> various machines) started sending NLMSG_DONE message (as they probably should've
> even before),

This comment shows the kernel commit that caused it:

  https://bugzilla.redhat.com/2302245#c4

This bug also points out that we're only reading a single response 
message, which could theoretically lead to missing the tail of a very 
long arp table. But that's another battle for another day.

> but our check for it could've never worked and now `virsh
> domifaddr --source arp` sometimes fails with "wrong nlmsg len".  So I set out on
> a quest to tame the netlink beast and though fierceful debugging and...  Oh, I
> forgot, nobody reads cover letters.  Never mind.

Oh come on!!! Just when it was getting interesting! Where is the gyring 
and gimbling in the wabe?? The mome raths?? The mimsy borogroves????

(in case that makes no sense: 
https://www.poetryfoundation.org/poems/42916/jabberwocky - my 3rd or 4th 
favorite poem, after 2 or 3 by Dr. Seuss)

> 
> Martin Kletzander (3):
>    virarptable: Properly calculate rtattr length
>    virarptable: Fix check for message length
>    virarptable: End parsing earlier in case of NLMSG_DONE
> 
>   src/util/virarptable.c | 11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
Re: [PATCH 0/3] Fix ARP table parsing over netlink messages
Posted by Martin Kletzander 3 months ago
On Fri, Aug 16, 2024 at 11:52:09PM -0400, Laine Stump wrote:
>On 8/16/24 8:45 AM, Martin Kletzander wrote:
>> Somehow it happened that some kernels (I noticed this with 6.10.0 and 6.10.2 on
>> various machines) started sending NLMSG_DONE message (as they probably should've
>> even before),
>
>This comment shows the kernel commit that caused it:
>
>  https://bugzilla.redhat.com/2302245#c4
>

Oh, it would've been nice to know someone else found it as well =D  My
bad, I guess.

>This bug also points out that we're only reading a single response
>message, which could theoretically lead to missing the tail of a very
>long arp table. But that's another battle for another day.
>

To be honest I did not try tracking down our usage/acceptance of
NLM_F_MULTI.  It's also one of the reasons I suggested using a tiny bit
more of the high level abstraction from libnl3 where we can leave that
multipart messages and bit of error handling to it.  More in 3/3.

>> but our check for it could've never worked and now `virsh
>> domifaddr --source arp` sometimes fails with "wrong nlmsg len".  So I set out on
>> a quest to tame the netlink beast and though fierceful debugging and...  Oh, I
>> forgot, nobody reads cover letters.  Never mind.
>
>Oh come on!!! Just when it was getting interesting! Where is the gyring
>and gimbling in the wabe?? The mome raths?? The mimsy borogroves????
>

Thank you for reading the commit message.  You shall be known as Laine
the reader from now on ;)

>(in case that makes no sense:
>https://www.poetryfoundation.org/poems/42916/jabberwocky - my 3rd or 4th
>favorite poem, after 2 or 3 by Dr. Seuss)
>

Sounds good, I just need to learn the language first =D

>>
>> Martin Kletzander (3):
>>    virarptable: Properly calculate rtattr length
>>    virarptable: Fix check for message length
>>    virarptable: End parsing earlier in case of NLMSG_DONE
>>
>>   src/util/virarptable.c | 11 +++++------
>>   1 file changed, 5 insertions(+), 6 deletions(-)
>>
>
Re: [PATCH 0/3] Fix ARP table parsing over netlink messages
Posted by Laine Stump 3 months ago
On 8/19/24 6:22 AM, Martin Kletzander wrote:
> On Fri, Aug 16, 2024 at 11:52:09PM -0400, Laine Stump wrote:

>> (in case that makes no sense:
>> https://www.poetryfoundation.org/poems/42916/jabberwocky - my 3rd or 4th
>> favorite poem, after 2 or 3 by Dr. Seuss)
>>
> 
> Sounds good, I just need to learn the language first =D

It may help to know that it was confusing enough to many native English 
speakers that a rumor started (and still persists) that Lewis Carroll 
was "high on psychadelic drugs" when he wrote both The Jabberwocky and 
Alice in Wonderland. According to the Lewis Carroll Society he wasn't, 
but it sure sounded like he was (he was just naturally a very wild and 
crazy thinking guy).