All of lore.kernel.org
 help / color / mirror / Atom feed
* [scosu-sched:topic/mmap-cap-prot-wip/v6.18 462/1130] net/bpf/bpf_dummy_struct_ops.c:43:18: warning: cast to pointer from integer of different size
@ 2026-05-21 10:10 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-05-21 10:10 UTC (permalink / raw)
  To: Christian Ehrhardt; +Cc: oe-kbuild-all

tree:   https://github.com/scosu/linux-sched topic/mmap-cap-prot-wip/v6.18
head:   f69a5a9d9fee15edde28429e23a4c749a59937bd
commit: e2a0a8156299c5b87411fce4727f2871edaccf23 [462/1130] [CHERRY-PICK] bpf: use user pointer types in uAPI structs
config: mips-allyesconfig (https://download.01.org/0day-ci/archive/20260521/202605211729.sQVBdZ76-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260521/202605211729.sQVBdZ76-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605211729.sQVBdZ76-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from include/linux/bpfptr.h:6,
                    from include/linux/bpf.h:28,
                    from include/linux/bpf_verifier.h:7,
                    from net/bpf/bpf_dummy_struct_ops.c:6:
   include/linux/compat.h:1119:9: warning: 'is_compat32_task' redefined
    1119 | #define is_compat32_task() (0)
         |         ^~~~~~~~~~~~~~~~
   In file included from include/linux/compat.h:22:
   arch/mips/include/asm/compat.h:157:9: note: this is the location of the previous definition
     157 | #define is_compat32_task is_compat_task
         |         ^~~~~~~~~~~~~~~~
   net/bpf/bpf_dummy_struct_ops.c: In function 'dummy_ops_init_args':
>> net/bpf/bpf_dummy_struct_ops.c:43:18: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      43 |         ctx_in = (void __user *)kattr->test.ctx_in;
         |                  ^
   net/bpf/bpf_dummy_struct_ops.c:48:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      48 |         u_state = (void __user *)args->args[0];
         |                   ^
   net/bpf/bpf_dummy_struct_ops.c: In function 'dummy_ops_copy_args':
   net/bpf/bpf_dummy_struct_ops.c:63:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
      63 |         u_state = (void __user *)args->args[0];
         |                   ^
--
   In file included from include/linux/bpfptr.h:6,
                    from include/linux/bpf.h:28,
                    from drivers/media/rc/bpf-lirc.c:6:
   include/linux/compat.h:1119:9: warning: 'is_compat32_task' redefined
    1119 | #define is_compat32_task() (0)
         |         ^~~~~~~~~~~~~~~~
   In file included from include/linux/compat.h:22:
   arch/mips/include/asm/compat.h:157:9: note: this is the location of the previous definition
     157 | #define is_compat32_task is_compat_task
         |         ^~~~~~~~~~~~~~~~
   drivers/media/rc/bpf-lirc.c: In function 'lirc_prog_query':
>> drivers/media/rc/bpf-lirc.c:297:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     297 |         __u32 __user *prog_ids = (__u32 __user *)attr->query.prog_ids;
         |                                  ^


vim +43 net/bpf/bpf_dummy_struct_ops.c

    26	
    27	static struct bpf_dummy_ops_test_args *
    28	dummy_ops_init_args(const union bpf_attr *kattr, unsigned int nr)
    29	{
    30		__u32 size_in;
    31		struct bpf_dummy_ops_test_args *args;
    32		void __user *ctx_in;
    33		void __user *u_state;
    34	
    35		size_in = kattr->test.ctx_size_in;
    36		if (size_in != sizeof(u64) * nr)
    37			return ERR_PTR(-EINVAL);
    38	
    39		args = kzalloc(sizeof(*args), GFP_KERNEL);
    40		if (!args)
    41			return ERR_PTR(-ENOMEM);
    42	
  > 43		ctx_in = (void __user *)kattr->test.ctx_in;
    44		if (copy_from_user(args->args, ctx_in, size_in))
    45			goto out;
    46	
    47		/* args[0] is 0 means state argument of test_N will be NULL */
    48		u_state = (void __user *)args->args[0];
    49		if (u_state && copy_from_user(&args->state, u_state,
    50					      sizeof(args->state)))
    51			goto out;
    52	
    53		return args;
    54	out:
    55		kfree(args);
    56		return ERR_PTR(-EFAULT);
    57	}
    58	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-21 10:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-21 10:10 [scosu-sched:topic/mmap-cap-prot-wip/v6.18 462/1130] net/bpf/bpf_dummy_struct_ops.c:43:18: warning: cast to pointer from integer of different size kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.