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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210130116.YP01zBgS-lkp@intel.com>
Date:   Thu, 13 Oct 2022 01:11:08 +0800
From:   kernel test robot <lkp@...el.com>
To:     Ard Biesheuvel <ardb@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/firmware/efi/efi.c:684:21: sparse: sparse: incorrect type in
 assignment (different address spaces)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   49da070062390094112b423ba443ea193527b2e4
commit: f4dc7fffa9873db50ec25624572f8217a6225de8 efi: libstub: unify initrd loading between architectures
date:   2 weeks ago
config: ia64-randconfig-s052-20221012
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f4dc7fffa9873db50ec25624572f8217a6225de8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout f4dc7fffa9873db50ec25624572f8217a6225de8
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/firmware/efi/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
   drivers/firmware/efi/efi.c:610:22: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct linux_efi_random_seed *seed @@     got void [noderef] __iomem * @@
   drivers/firmware/efi/efi.c:610:22: sparse:     expected struct linux_efi_random_seed *seed
   drivers/firmware/efi/efi.c:610:22: sparse:     got void [noderef] __iomem *
   drivers/firmware/efi/efi.c:613:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got struct linux_efi_random_seed *seed @@
   drivers/firmware/efi/efi.c:613:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/firmware/efi/efi.c:613:25: sparse:     got struct linux_efi_random_seed *seed
   drivers/firmware/efi/efi.c:618:30: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct linux_efi_random_seed *seed @@     got void [noderef] __iomem * @@
   drivers/firmware/efi/efi.c:618:30: sparse:     expected struct linux_efi_random_seed *seed
   drivers/firmware/efi/efi.c:618:30: sparse:     got void [noderef] __iomem *
   drivers/firmware/efi/efi.c:623:33: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got struct linux_efi_random_seed *seed @@
   drivers/firmware/efi/efi.c:623:33: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/firmware/efi/efi.c:623:33: sparse:     got struct linux_efi_random_seed *seed
   drivers/firmware/efi/efi.c:647:27: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected unsigned char [usertype] *p @@     got void [noderef] __iomem * @@
   drivers/firmware/efi/efi.c:647:27: sparse:     expected unsigned char [usertype] *p
   drivers/firmware/efi/efi.c:647:27: sparse:     got void [noderef] __iomem *
   drivers/firmware/efi/efi.c:666:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got unsigned char [usertype] *p @@
   drivers/firmware/efi/efi.c:666:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/firmware/efi/efi.c:666:25: sparse:     got unsigned char [usertype] *p
   drivers/firmware/efi/efi.c:673:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct efi_rt_properties_table_t [usertype] *tbl @@     got void [noderef] __iomem * @@
   drivers/firmware/efi/efi.c:673:21: sparse:     expected struct efi_rt_properties_table_t [usertype] *tbl
   drivers/firmware/efi/efi.c:673:21: sparse:     got void [noderef] __iomem *
   drivers/firmware/efi/efi.c:676:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got struct efi_rt_properties_table_t [usertype] *tbl @@
   drivers/firmware/efi/efi.c:676:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/firmware/efi/efi.c:676:25: sparse:     got struct efi_rt_properties_table_t [usertype] *tbl
>> drivers/firmware/efi/efi.c:684:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct linux_efi_initrd *tbl @@     got void [noderef] __iomem * @@
   drivers/firmware/efi/efi.c:684:21: sparse:     expected struct linux_efi_initrd *tbl
   drivers/firmware/efi/efi.c:684:21: sparse:     got void [noderef] __iomem *
>> drivers/firmware/efi/efi.c:688:25: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got struct linux_efi_initrd *tbl @@
   drivers/firmware/efi/efi.c:688:25: sparse:     expected void volatile [noderef] __iomem *addr
   drivers/firmware/efi/efi.c:688:25: sparse:     got struct linux_efi_initrd *tbl

vim +684 drivers/firmware/efi/efi.c

   569	
   570	int __init efi_config_parse_tables(const efi_config_table_t *config_tables,
   571					   int count,
   572					   const efi_config_table_type_t *arch_tables)
   573	{
   574		const efi_config_table_64_t *tbl64 = (void *)config_tables;
   575		const efi_config_table_32_t *tbl32 = (void *)config_tables;
   576		const efi_guid_t *guid;
   577		unsigned long table;
   578		int i;
   579	
   580		pr_info("");
   581		for (i = 0; i < count; i++) {
   582			if (!IS_ENABLED(CONFIG_X86)) {
   583				guid = &config_tables[i].guid;
   584				table = (unsigned long)config_tables[i].table;
   585			} else if (efi_enabled(EFI_64BIT)) {
   586				guid = &tbl64[i].guid;
   587				table = tbl64[i].table;
   588	
   589				if (IS_ENABLED(CONFIG_X86_32) &&
   590				    tbl64[i].table > U32_MAX) {
   591					pr_cont("\n");
   592					pr_err("Table located above 4GB, disabling EFI.\n");
   593					return -EINVAL;
   594				}
   595			} else {
   596				guid = &tbl32[i].guid;
   597				table = tbl32[i].table;
   598			}
   599	
   600			if (!match_config_table(guid, table, common_tables) && arch_tables)
   601				match_config_table(guid, table, arch_tables);
   602		}
   603		pr_cont("\n");
   604		set_bit(EFI_CONFIG_TABLES, &efi.flags);
   605	
   606		if (efi_rng_seed != EFI_INVALID_TABLE_ADDR) {
   607			struct linux_efi_random_seed *seed;
   608			u32 size = 0;
   609	
   610			seed = early_memremap(efi_rng_seed, sizeof(*seed));
   611			if (seed != NULL) {
   612				size = READ_ONCE(seed->size);
   613				early_memunmap(seed, sizeof(*seed));
   614			} else {
   615				pr_err("Could not map UEFI random seed!\n");
   616			}
   617			if (size > 0) {
   618				seed = early_memremap(efi_rng_seed,
   619						      sizeof(*seed) + size);
   620				if (seed != NULL) {
   621					pr_notice("seeding entropy pool\n");
   622					add_bootloader_randomness(seed->bits, size);
   623					early_memunmap(seed, sizeof(*seed) + size);
   624				} else {
   625					pr_err("Could not map UEFI random seed!\n");
   626				}
   627			}
   628		}
   629	
   630		if (!IS_ENABLED(CONFIG_X86_32) && efi_enabled(EFI_MEMMAP))
   631			efi_memattr_init();
   632	
   633		efi_tpm_eventlog_init();
   634	
   635		if (mem_reserve != EFI_INVALID_TABLE_ADDR) {
   636			unsigned long prsv = mem_reserve;
   637	
   638			while (prsv) {
   639				struct linux_efi_memreserve *rsv;
   640				u8 *p;
   641	
   642				/*
   643				 * Just map a full page: that is what we will get
   644				 * anyway, and it permits us to map the entire entry
   645				 * before knowing its size.
   646				 */
   647				p = early_memremap(ALIGN_DOWN(prsv, PAGE_SIZE),
   648						   PAGE_SIZE);
   649				if (p == NULL) {
   650					pr_err("Could not map UEFI memreserve entry!\n");
   651					return -ENOMEM;
   652				}
   653	
   654				rsv = (void *)(p + prsv % PAGE_SIZE);
   655	
   656				/* reserve the entry itself */
   657				memblock_reserve(prsv,
   658						 struct_size(rsv, entry, rsv->size));
   659	
   660				for (i = 0; i < atomic_read(&rsv->count); i++) {
   661					memblock_reserve(rsv->entry[i].base,
   662							 rsv->entry[i].size);
   663				}
   664	
   665				prsv = rsv->next;
   666				early_memunmap(p, PAGE_SIZE);
   667			}
   668		}
   669	
   670		if (rt_prop != EFI_INVALID_TABLE_ADDR) {
   671			efi_rt_properties_table_t *tbl;
   672	
   673			tbl = early_memremap(rt_prop, sizeof(*tbl));
   674			if (tbl) {
   675				efi.runtime_supported_mask &= tbl->runtime_services_supported;
   676				early_memunmap(tbl, sizeof(*tbl));
   677			}
   678		}
   679	
   680		if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) &&
   681		    initrd != EFI_INVALID_TABLE_ADDR && phys_initrd_size == 0) {
   682			struct linux_efi_initrd *tbl;
   683	
 > 684			tbl = early_memremap(initrd, sizeof(*tbl));
   685			if (tbl) {
   686				phys_initrd_start = tbl->base;
   687				phys_initrd_size = tbl->size;
 > 688				early_memunmap(tbl, sizeof(*tbl));
   689			}
   690		}
   691	
   692		return 0;
   693	}
   694	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (131434 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ