Re: git: 6a09a7f1e9a5 - main - netlink: always zero provided header buffers.

From: Alexander Chernikov <melifaro_at_FreeBSD.org>
Date: Mon, 01 May 2023 14:58:10 UTC

> On 1 May 2023, at 15:30, Renato Botelho <garga@freebsd.org> wrote:
> 
> On 01/05/23 11:09, Alexander V. Chernikov wrote:
>> The branch main has been updated by melifaro:
>> URL: https://cgit.FreeBSD.org/src/commit/?id=6a09a7f1e9a52fb25158ca60216c6b817f8c0b71
>> commit 6a09a7f1e9a52fb25158ca60216c6b817f8c0b71
>> Author:     Alexander V. Chernikov <melifaro@FreeBSD.org>
>> AuthorDate: 2023-05-01 14:07:33 +0000
>> Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
>> CommitDate: 2023-05-01 14:09:47 +0000
>>     netlink: always zero provided header buffers.
>>          Reported by:    KMSAN
>>     MFC after:      3 days
>> ---
>>  sys/netlink/netlink_message_writer.h | 1 +
>>  sys/netlink/route/neigh.c            | 3 ---
>>  2 files changed, 1 insertion(+), 3 deletions(-)
>> diff --git a/sys/netlink/netlink_message_writer.h b/sys/netlink/netlink_message_writer.h
>> index 57fc1bf342ea..92e43834efc7 100644
>> --- a/sys/netlink/netlink_message_writer.h
>> +++ b/sys/netlink/netlink_message_writer.h
>> @@ -225,6 +225,7 @@ nlmsg_reserve_data_raw(struct nl_writer *nw, size_t sz)
>>            void *data_ptr = &nw->data[nw->offset];
>>          nw->offset += sz;
>> +	bzero(data_ptr, sz);
> 
> At first look, this line seems to be indented wrong.  But looking at cgit web interface it seems that other lines are wrong and this is correct.
Ups. Somehow I messed with spaces. Thanks for pointing this out! Should be fixed by 88406e631e93.

/Alexander
> -- 
> Renato Botelho
>