On 06.11.2019 22:43, Christos Zoulas wrote:
> In article <20191106130732.c6c5af...@cvs.netbsd.org>,
> Kamil Rytarowski <source-changes-d@NetBSD.org> wrote:
>> -=-=-=-=-=-
>>
>> Module Name: src
>> Committed By:        kamil
>> Date:                Wed Nov  6 13:07:32 UTC 2019
>>
>> Modified Files:
>>      src/sys/kern: subr_disk_mbr.c
>>
>> Log Message:
>> Avoid unaligned pointer arithmetic in check_label_magic()
>>
>> Replace the logic of calculating the address with with base + offset.
>>
>> Reported by GCC8.
>>
>> Reported-by:
>> syzbot+56769dece0ec3e357...@syzkaller.appspotmail.com
> 
> I consider this a false positive and the new code less readable. This looks
> more like "appease the sanitizer"...
> 
> christos
> 

Technically, I think that this is a real UB.

6.3.2.3/7
A pointer to an object type may be converted to a pointer to a
different object type. If the resulting pointer is not correctly
aligned for the referenced type, the behavior is undefined.

I agree that this is appeasing the sanitizer.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to