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: <202108142031.4ZMZDpLa-lkp@intel.com>
Date:   Sat, 14 Aug 2021 20:06:41 +0800
From:   kernel test robot <lkp@...el.com>
To:     Luis Chamberlain <mcgrof@...nel.org>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [mcgrof-next:20210813-sysfs-fixes-v8 7/10]
 arch/x86/kernel/cpu/resctrl/rdtgroup.c:212:13: warning: passing argument 7
 of '__kernfs_create_file' makes integer from pointer without a cast

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20210813-sysfs-fixes-v8
head:   f5b8aadeca76656caad8bccc795bfe7b0730230a
commit: da898d13309d7b2855a74ee4e49e0fb43a55a2f1 [7/10] sysfs: fix deadlock race with module removal
config: i386-randconfig-c001-20210812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/commit/?id=da898d13309d7b2855a74ee4e49e0fb43a55a2f1
        git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
        git fetch --no-tags mcgrof-next 20210813-sysfs-fixes-v8
        git checkout da898d13309d7b2855a74ee4e49e0fb43a55a2f1
        # save the attached .config to linux build tree
        make W=1 ARCH=i386 

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

All warnings (new ones prefixed by >>):

   In file included from include/linux/ipc.h:6,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/sched.h:15,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   arch/x86/kernel/cpu/resctrl/rdtgroup.c: In function 'rdtgroup_add_file':
   include/linux/uidgid.h:30:35: error: incompatible type for argument 4 of '__kernfs_create_file'
      30 | #define KUIDT_INIT(value) (kuid_t){ value }
         |                                   ^~~~~~~~~
         |                                   |
         |                                   kuid_t {aka struct <anonymous>}
   include/linux/uidgid.h:55:25: note: in expansion of macro 'KUIDT_INIT'
      55 | #define GLOBAL_ROOT_UID KUIDT_INIT(0)
         |                         ^~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:211:7: note: in expansion of macro 'GLOBAL_ROOT_UID'
     211 |       GLOBAL_ROOT_UID, GLOBAL_ROOT_GID,
         |       ^~~~~~~~~~~~~~~
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: expected 'struct module *' but argument is of type 'kuid_t' {aka 'struct <anonymous>'}
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/ipc.h:6,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/sched.h:15,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/uidgid.h:31:35: error: incompatible type for argument 5 of '__kernfs_create_file'
      31 | #define KGIDT_INIT(value) (kgid_t){ value }
         |                                   ^~~~~~~~~
         |                                   |
         |                                   kgid_t {aka struct <anonymous>}
   include/linux/uidgid.h:56:25: note: in expansion of macro 'KGIDT_INIT'
      56 | #define GLOBAL_ROOT_GID KGIDT_INIT(0)
         |                         ^~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:211:24: note: in expansion of macro 'GLOBAL_ROOT_GID'
     211 |       GLOBAL_ROOT_UID, GLOBAL_ROOT_GID,
         |                        ^~~~~~~~~~~~~~~
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: expected 'kuid_t' {aka 'struct <anonymous>'} but argument is of type 'kgid_t' {aka 'struct <anonymous>'}
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:212:7: error: incompatible type for argument 6 of '__kernfs_create_file'
     212 |       0, rft->kf_ops, rft, NULL, NULL);
         |       ^
         |       |
         |       int
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: expected 'kgid_t' {aka 'struct <anonymous>'} but argument is of type 'int'
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
>> arch/x86/kernel/cpu/resctrl/rdtgroup.c:212:13: warning: passing argument 7 of '__kernfs_create_file' makes integer from pointer without a cast [-Wint-conversion]
     212 |       0, rft->kf_ops, rft, NULL, NULL);
         |          ~~~^~~~~~~~
         |             |
         |             const struct kernfs_ops *
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: expected 'loff_t' {aka 'long long int'} but argument is of type 'const struct kernfs_ops *'
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:212:23: error: passing argument 8 of '__kernfs_create_file' from incompatible pointer type [-Werror=incompatible-pointer-types]
     212 |       0, rft->kf_ops, rft, NULL, NULL);
         |                       ^~~
         |                       |
         |                       struct rftype *
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: expected 'const struct kernfs_ops *' but argument is of type 'struct rftype *'
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:210:7: error: too few arguments to function '__kernfs_create_file'
     210 |  kn = __kernfs_create_file(parent_kn, rft->name, rft->mode,
         |       ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: declared here
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/ipc.h:6,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/sched.h:15,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   arch/x86/kernel/cpu/resctrl/rdtgroup.c: In function 'mon_addfile':
   include/linux/uidgid.h:30:35: error: incompatible type for argument 4 of '__kernfs_create_file'
      30 | #define KUIDT_INIT(value) (kuid_t){ value }
         |                                   ^~~~~~~~~
         |                                   |
         |                                   kuid_t {aka struct <anonymous>}
   include/linux/uidgid.h:55:25: note: in expansion of macro 'KUIDT_INIT'
      55 | #define GLOBAL_ROOT_UID KUIDT_INIT(0)
         |                         ^~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:2484:7: note: in expansion of macro 'GLOBAL_ROOT_UID'
    2484 |       GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, 0,
         |       ^~~~~~~~~~~~~~~
   In file included from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/energy_model.h:7,
                    from include/linux/device.h:16,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/kernfs.h:382:21: note: expected 'struct module *' but argument is of type 'kuid_t' {aka 'struct <anonymous>'}
     382 | struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
         |                     ^~~~~~~~~~~~~~~~~~~~
   In file included from include/linux/ipc.h:6,
                    from include/uapi/linux/sem.h:5,
                    from include/linux/sem.h:5,
                    from include/linux/sched.h:15,
                    from include/linux/ratelimit.h:6,
                    from include/linux/dev_printk.h:16,
                    from include/linux/device.h:15,
                    from include/linux/node.h:18,
                    from include/linux/cpu.h:17,
                    from include/linux/cacheinfo.h:6,
                    from arch/x86/kernel/cpu/resctrl/rdtgroup.c:15:
   include/linux/uidgid.h:31:35: error: incompatible type for argument 5 of '__kernfs_create_file'
      31 | #define KGIDT_INIT(value) (kgid_t){ value }
         |                                   ^~~~~~~~~
         |                                   |
         |                                   kgid_t {aka struct <anonymous>}
   include/linux/uidgid.h:56:25: note: in expansion of macro 'KGIDT_INIT'
      56 | #define GLOBAL_ROOT_GID KGIDT_INIT(0)
         |                         ^~~~~~~~~~
   arch/x86/kernel/cpu/resctrl/rdtgroup.c:2484:24: note: in expansion of macro 'GLOBAL_ROOT_GID'
    2484 |       GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, 0,


vim +/__kernfs_create_file +212 arch/x86/kernel/cpu/resctrl/rdtgroup.c

4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  204  
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  205  static int rdtgroup_add_file(struct kernfs_node *parent_kn, struct rftype *rft)
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  206  {
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  207  	struct kernfs_node *kn;
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  208  	int ret;
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  209  
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  210  	kn = __kernfs_create_file(parent_kn, rft->name, rft->mode,
488dee96bb62f0 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Dmitry Torokhov 2018-07-20  211  				  GLOBAL_ROOT_UID, GLOBAL_ROOT_GID,
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28 @212  				  0, rft->kf_ops, rft, NULL, NULL);
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  213  	if (IS_ERR(kn))
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  214  		return PTR_ERR(kn);
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  215  
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  216  	ret = rdtgroup_kn_set_ugid(kn);
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  217  	if (ret) {
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  218  		kernfs_remove(kn);
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  219  		return ret;
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  220  	}
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  221  
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  222  	return 0;
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  223  }
4e978d06dedb82 arch/x86/kernel/cpu/intel_rdt_rdtgroup.c Fenghua Yu      2016-10-28  224  

:::::: The code at line 212 was first introduced by commit
:::::: 4e978d06dedb8207b298a5a8a49fce4b2ab80d12 x86/intel_rdt: Add "info" files to resctrl file system

:::::: TO: Fenghua Yu <fenghua.yu@...el.com>
:::::: CC: Thomas Gleixner <tglx@...utronix.de>

---
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" (32478 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ