Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 159c1525 in mainline


Ignore:
Timestamp:
2018-11-13T16:08:22Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master
Children:
780edc7, b60615b
Parents:
cbf528f
Message:

may_alias attribute is not sufficient to avoid ubsan report

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/genarch/src/acpi/acpi.c

    rcbf528f r159c1525  
    171171}
    172172
    173 typedef uint64_t _a64_t __attribute__((may_alias));
    174 
    175173static uint8_t *search_rsdp(uint8_t *base, size_t len)
    176174{
    177         uint64_t signature = *(_a64_t *) RSDP_SIGNATURE;
    178 
    179175        for (size_t i = 0; i < len; i += 16) {
    180                 if (*((_a64_t *) &base[i]) == signature && rsdp_check(&base[i]))
     176                if (__builtin_memcmp(&base[i], RSDP_SIGNATURE, 8) &&
     177                    rsdp_check(&base[i]))
    181178                        return &base[i];
    182179        }
Note: See TracChangeset for help on using the changeset viewer.