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>] [day] [month] [year] [list]
Message-ID: <20200908174918.GR8321@kadam>
Date:   Tue, 8 Sep 2020 20:49:18 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Peng Fan <peng.fan@....com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Shawn Guo <shawnguo@...nel.org>
Subject: [kbuild] drivers/irqchip/irq-gic-v3-mbi.c:306 mbi_init() warn:
 impossible condition '(mbi_phys_base == (-1)) => (0-u32max == u64max)'

Hi Peng,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git  master
head:   f4d51dffc6c01a9e94650d95ce0104964f8ae822
commit: d82bcef5157de1368c08244a846ab968b3e5cb7e soc: imx: select ARM_GIC_V3 for i.MX8M
config: arm-randconfig-m031-20200908 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

smatch warnings:
drivers/irqchip/irq-gic-v3-mbi.c:306 mbi_init() warn: impossible condition '(mbi_phys_base == (-1)) => (0-u32max == u64max)'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d82bcef5157de1368c08244a846ab968b3e5cb7e 
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
git fetch --no-tags linus master
git checkout d82bcef5157de1368c08244a846ab968b3e5cb7e
vim +306 drivers/irqchip/irq-gic-v3-mbi.c

505287525c24d5 Marc Zyngier 2018-05-08  263  int __init mbi_init(struct fwnode_handle *fwnode, struct irq_domain *parent)
505287525c24d5 Marc Zyngier 2018-05-08  264  {
505287525c24d5 Marc Zyngier 2018-05-08  265  	struct device_node *np;
505287525c24d5 Marc Zyngier 2018-05-08  266  	const __be32 *reg;
505287525c24d5 Marc Zyngier 2018-05-08  267  	int ret, n;
505287525c24d5 Marc Zyngier 2018-05-08  268  
505287525c24d5 Marc Zyngier 2018-05-08  269  	np = to_of_node(fwnode);
505287525c24d5 Marc Zyngier 2018-05-08  270  
505287525c24d5 Marc Zyngier 2018-05-08  271  	if (!of_property_read_bool(np, "msi-controller"))
505287525c24d5 Marc Zyngier 2018-05-08  272  		return 0;
505287525c24d5 Marc Zyngier 2018-05-08  273  
505287525c24d5 Marc Zyngier 2018-05-08  274  	n = of_property_count_elems_of_size(np, "mbi-ranges", sizeof(u32));
505287525c24d5 Marc Zyngier 2018-05-08  275  	if (n <= 0 || n % 2)
505287525c24d5 Marc Zyngier 2018-05-08  276  		return -EINVAL;
505287525c24d5 Marc Zyngier 2018-05-08  277  
505287525c24d5 Marc Zyngier 2018-05-08  278  	mbi_range_nr = n / 2;
505287525c24d5 Marc Zyngier 2018-05-08  279  	mbi_ranges = kcalloc(mbi_range_nr, sizeof(*mbi_ranges), GFP_KERNEL);
505287525c24d5 Marc Zyngier 2018-05-08  280  	if (!mbi_ranges)
505287525c24d5 Marc Zyngier 2018-05-08  281  		return -ENOMEM;
505287525c24d5 Marc Zyngier 2018-05-08  282  
505287525c24d5 Marc Zyngier 2018-05-08  283  	for (n = 0; n < mbi_range_nr; n++) {
505287525c24d5 Marc Zyngier 2018-05-08  284  		ret = of_property_read_u32_index(np, "mbi-ranges", n * 2,
505287525c24d5 Marc Zyngier 2018-05-08  285  						 &mbi_ranges[n].spi_start);
505287525c24d5 Marc Zyngier 2018-05-08  286  		if (ret)
505287525c24d5 Marc Zyngier 2018-05-08  287  			goto err_free_mbi;
505287525c24d5 Marc Zyngier 2018-05-08  288  		ret = of_property_read_u32_index(np, "mbi-ranges", n * 2 + 1,
505287525c24d5 Marc Zyngier 2018-05-08  289  						 &mbi_ranges[n].nr_spis);
505287525c24d5 Marc Zyngier 2018-05-08  290  		if (ret)
505287525c24d5 Marc Zyngier 2018-05-08  291  			goto err_free_mbi;
505287525c24d5 Marc Zyngier 2018-05-08  292  
505287525c24d5 Marc Zyngier 2018-05-08  293  		mbi_ranges[n].bm = kcalloc(BITS_TO_LONGS(mbi_ranges[n].nr_spis),
505287525c24d5 Marc Zyngier 2018-05-08  294  					   sizeof(long), GFP_KERNEL);
505287525c24d5 Marc Zyngier 2018-05-08  295  		if (!mbi_ranges[n].bm) {
505287525c24d5 Marc Zyngier 2018-05-08  296  			ret = -ENOMEM;
505287525c24d5 Marc Zyngier 2018-05-08  297  			goto err_free_mbi;
505287525c24d5 Marc Zyngier 2018-05-08  298  		}
505287525c24d5 Marc Zyngier 2018-05-08  299  		pr_info("MBI range [%d:%d]\n", mbi_ranges[n].spi_start,
505287525c24d5 Marc Zyngier 2018-05-08  300  			mbi_ranges[n].spi_start + mbi_ranges[n].nr_spis - 1);
505287525c24d5 Marc Zyngier 2018-05-08  301  	}
505287525c24d5 Marc Zyngier 2018-05-08  302  
505287525c24d5 Marc Zyngier 2018-05-08  303  	reg = of_get_property(np, "mbi-alias", NULL);
505287525c24d5 Marc Zyngier 2018-05-08  304  	if (reg) {
505287525c24d5 Marc Zyngier 2018-05-08  305  		mbi_phys_base = of_translate_address(np, reg);
505287525c24d5 Marc Zyngier 2018-05-08 @306  		if (mbi_phys_base == OF_BAD_ADDR) {
                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Impossible condition.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org 

Download attachment ".config.gz" of type "application/gzip" (42555 bytes)

_______________________________________________
kbuild mailing list -- kbuild@...ts.01.org
To unsubscribe send an email to kbuild-leave@...ts.01.org

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ