lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1fe1aa97-97dc-4f55-186e-7aace630c8f1@huawei.com>
Date:   Wed, 15 Sep 2021 17:38:26 +0800
From:   Bixuan Cui <cuibixuan@...wei.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        <linux-kernel@...r.kernel.org>
CC:     <maz@...nel.org>, <john.wanghui@...wei.com>
Subject: Re: [PATCH -next] irqdomain: fix overflow error



On 2021/9/15 15:49, Thomas Gleixner wrote:
> On Wed, Sep 15 2021 at 10:03, Bixuan Cui wrote:
>> On 2021/9/14 19:56, Thomas Gleixner wrote:
>>
>> And kernel/irq/irqdomain.c
>> struct irq_domain *irq_domain_create_simple(struct fwnode_handle *fwnode,
>>                                             unsigned int size,
>>                                             unsigned int first_irq,
>>                                             const struct irq_domain_ops *ops,
>>                                             void *host_data)
>> {
>>         struct irq_domain *domain;
>>
>>         domain = __irq_domain_add(fwnode, size, size, 0, ops, host_data);
>>
>> All 'size' passed to __irq_domain_add() are unsigned int.
>>
>> So I think it's more appropriate to replace it with unsigned int.
> Appropriate is not really a technical reason. Making the code consistent
> is.
> 
> But that has nothing to do with the completely bogus compiler warning in
> the changelog you provided.
Hello,
It is a real compilation warning, It occurs when compiled with
.config(https://syzkaller.appspot.com/text?tag=KernelConfig&x=4d196bb8b1e038c0).

This is my compile log:
// cp .config from https://syzkaller.appspot.com/text?tag=KernelConfig&x=4d196bb8b1e038c0
$ make menuconfig
$ make kernel/irq/irqdomain.o
  SYNC    include/config/auto.conf.cmd
  DESCEND objtool
  CALL    scripts/atomic/check-atomics.sh
  CALL    scripts/checksyscalls.sh
  CC      kernel/irq/irqdomain.o
In file included from ./include/linux/resource_ext.h:11:0,
                 from ./include/linux/acpi.h:14,
                 from kernel/irq/irqdomain.c:5:
In function ‘kmalloc_node’,
    inlined from ‘kzalloc_node.constprop’ at ./include/linux/slab.h:743:9,
    inlined from ‘__irq_domain_add’ at kernel/irq/irqdomain.c:153:9:
./include/linux/slab.h:618:9: warning: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
  return __kmalloc_node(size, flags, node);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/slab.h: In function ‘__irq_domain_add’:
./include/linux/slab.h:455:7: note: in a call to allocation function ‘__kmalloc_node’ declared here
 void *__kmalloc_node(size_t size, gfp_t flags, int node) __assume_slab_alignment __malloc;
       ^~~~~~~~~~~~~~

Thanks,
Bixuan Cui




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ