CC: [email protected]
TO: Nathan Chancellor <[email protected]>
CC: 0day robot <[email protected]>

tree:   
https://github.com/0day-ci/linux/commits/UPDATE-20210128-095409/Nathan-Chancellor/ubsan-Implement-__ubsan_handle_alignment_assumption/20210113-055714
head:   28b733a6a9d9687dbd81280c18f21106522d97ec
commit: 28b733a6a9d9687dbd81280c18f21106522d97ec ubsan: Implement 
__ubsan_handle_alignment_assumption
date:   10 hours ago
:::::: branch date: 10 hours ago
:::::: commit date: 10 hours ago
config: nds32-randconfig-m031-20210128 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
lib/ubsan.c:454 __ubsan_handle_alignment_assumption() warn: should '(((1))) << 
((real_ptr) ?__ffs(real_ptr):0)' be a 64 bit type?

vim +454 lib/ubsan.c

28b733a6a9d968 Nathan Chancellor 2021-01-27  430  
28b733a6a9d968 Nathan Chancellor 2021-01-27  431  void 
__ubsan_handle_alignment_assumption(void *_data, unsigned long ptr,
28b733a6a9d968 Nathan Chancellor 2021-01-27  432                                
         unsigned long align,
28b733a6a9d968 Nathan Chancellor 2021-01-27  433                                
         unsigned long offset);
28b733a6a9d968 Nathan Chancellor 2021-01-27  434  void 
__ubsan_handle_alignment_assumption(void *_data, unsigned long ptr,
28b733a6a9d968 Nathan Chancellor 2021-01-27  435                                
         unsigned long align,
28b733a6a9d968 Nathan Chancellor 2021-01-27  436                                
         unsigned long offset)
28b733a6a9d968 Nathan Chancellor 2021-01-27  437  {
28b733a6a9d968 Nathan Chancellor 2021-01-27  438        struct 
alignment_assumption_data *data = _data;
28b733a6a9d968 Nathan Chancellor 2021-01-27  439        unsigned long real_ptr;
28b733a6a9d968 Nathan Chancellor 2021-01-27  440  
28b733a6a9d968 Nathan Chancellor 2021-01-27  441        if 
(suppress_report(&data->location))
28b733a6a9d968 Nathan Chancellor 2021-01-27  442                return;
28b733a6a9d968 Nathan Chancellor 2021-01-27  443  
28b733a6a9d968 Nathan Chancellor 2021-01-27  444        
ubsan_prologue(&data->location, "alignment-assumption");
28b733a6a9d968 Nathan Chancellor 2021-01-27  445  
28b733a6a9d968 Nathan Chancellor 2021-01-27  446        if (offset)
28b733a6a9d968 Nathan Chancellor 2021-01-27  447                
pr_err("assumption of %lu byte alignment (with offset of %lu byte) for pointer 
of type %s failed",
28b733a6a9d968 Nathan Chancellor 2021-01-27  448                       align, 
offset, data->type->type_name);
28b733a6a9d968 Nathan Chancellor 2021-01-27  449        else
28b733a6a9d968 Nathan Chancellor 2021-01-27  450                
pr_err("assumption of %lu byte alignment for pointer of type %s failed",
28b733a6a9d968 Nathan Chancellor 2021-01-27  451                       align, 
data->type->type_name);
28b733a6a9d968 Nathan Chancellor 2021-01-27  452  
28b733a6a9d968 Nathan Chancellor 2021-01-27  453        real_ptr = ptr - offset;
28b733a6a9d968 Nathan Chancellor 2021-01-27 @454        pr_err("%saddress is 
%lu aligned, misalignment offset is %lu bytes",

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to