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]
Date:   Fri, 10 Jun 2022 01:55:31 +0800
From:   kernel test robot <lkp@...el.com>
To:     Yuan Yao <yuan.yao@...el.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Isaku Yamahata <isaku.yamahata@...el.com>
Subject: [intel-tdx:kvm-upstream-workaround 449/453]
 arch/x86/kernel/fpu/xstate.c:719:7: warning: format specifies type 'long'
 but the argument has type 'unsigned int'

tree:   https://github.com/intel/tdx.git kvm-upstream-workaround
head:   64f3ddf316eab9398414b94e62a01d185e6e94c8
commit: c00f6297349a8d81049eefe338ee079179787e28 [449/453] X86: FPU: Fix unexpected #PF while executing XRSTORS
config: i386-randconfig-a013 (https://download.01.org/0day-ci/archive/20220610/202206100124.87NJ8YRo-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 971e13d69e3e7b687213fef22952be6a328c426c)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/intel/tdx/commit/c00f6297349a8d81049eefe338ee079179787e28
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx kvm-upstream-workaround
        git checkout c00f6297349a8d81049eefe338ee079179787e28
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/kernel/fpu/

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

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/fpu/xstate.c:719:7: warning: format specifies type 'long' but the argument has type 'unsigned int' [-Wformat]
                sizeof(init_fpstate_full), kernel_size);
                ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/asm-generic/bug.h:133:29: note: expanded from macro 'WARN'
                   __WARN_printf(TAINT_WARN, format);                      \
                                             ^~~~~~
   include/asm-generic/bug.h:105:17: note: expanded from macro '__WARN_printf'
                   __warn_printk(arg);                                     \
                                 ^~~
   1 warning generated.


vim +719 arch/x86/kernel/fpu/xstate.c

   685	
   686	static int __init init_xstate_size(void)
   687	{
   688		/* Recompute the context size for enabled features: */
   689		unsigned int user_size, kernel_size, kernel_default_size;
   690		bool compacted = cpu_feature_enabled(X86_FEATURE_XSAVES);
   691	
   692		/* Uncompacted user space size */
   693		user_size = get_xsave_size_user();
   694	
   695		/*
   696		 * XSAVES kernel size includes supervisor states and
   697		 * uses compacted format when available.
   698		 *
   699		 * XSAVE does not support supervisor states so
   700		 * kernel and user size is identical.
   701		 */
   702		if (compacted)
   703			kernel_size = get_xsaves_size_no_independent();
   704		else
   705			kernel_size = user_size;
   706	
   707		kernel_default_size =
   708			xstate_calculate_size(fpu_kernel_cfg.default_features, compacted);
   709	
   710		/* Ensure we have the space to store all default enabled features. */
   711		if (!is_supported_xstate_size(kernel_default_size))
   712			return -EINVAL;
   713	
   714		if (!paranoid_xstate_size_valid(kernel_size))
   715			return -EINVAL;
   716	
   717		WARN(kernel_size > sizeof(init_fpstate_full),
   718		     "Too small init_fpstate size:%ld expected:%d\n",
 > 719		     sizeof(init_fpstate_full), kernel_size);
   720	
   721		fpu_kernel_cfg.max_size = kernel_size;
   722		fpu_user_cfg.max_size = user_size;
   723	
   724		fpu_kernel_cfg.default_size = kernel_default_size;
   725		fpu_user_cfg.default_size =
   726			xstate_calculate_size(fpu_user_cfg.default_features, false);
   727	
   728		return 0;
   729	}
   730	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ