Thread (21 messages) 21 messages, 3 authors, 2024-02-20

Re: [PATCH v1 net-next 02/16] af_unix: Allocate struct unix_edge for each inflight AF_UNIX fd.

From: kernel test robot <hidden>
Date: 2024-02-03 20:21:30
Also in: llvm, oe-kbuild-all

Hi Kuniyuki,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Kuniyuki-Iwashima/af_unix-Add-struct-unix_vertex-in-struct-unix_sock/20240203-110847
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240203030058.60750-3-kuniyu%40amazon.com
patch subject: [PATCH v1 net-next 02/16] af_unix: Allocate struct unix_edge for each inflight AF_UNIX fd.
config: i386-buildonly-randconfig-004-20240203 (https://download.01.org/0day-ci/archive/20240204/202402040416.3h4bSPKV-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240204/202402040416.3h4bSPKV-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 [off-list ref]
| Closes: https://lore.kernel.org/oe-kbuild-all/202402040416.3h4bSPKV-lkp@intel.com/ (local)

All errors (new ones prefixed by >>):
quoted
net/core/scm.c:90:8: error: no member named 'edges' in 'struct scm_fp_list'
      90 |                 fpl->edges = NULL;
         |                 ~~~  ^
   net/core/scm.c:381:12: error: no member named 'edges' in 'struct scm_fp_list'
     381 |                 new_fpl->edges = NULL;
         |                 ~~~~~~~  ^
   2 errors generated.


vim +90 net/core/scm.c

    66	
    67	static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp)
    68	{
    69		int *fdp = (int*)CMSG_DATA(cmsg);
    70		struct scm_fp_list *fpl = *fplp;
    71		struct file **fpp;
    72		int i, num;
    73	
    74		num = (cmsg->cmsg_len - sizeof(struct cmsghdr))/sizeof(int);
    75	
    76		if (num <= 0)
    77			return 0;
    78	
    79		if (num > SCM_MAX_FD)
    80			return -EINVAL;
    81	
    82		if (!fpl)
    83		{
    84			fpl = kmalloc(sizeof(struct scm_fp_list), GFP_KERNEL_ACCOUNT);
    85			if (!fpl)
    86				return -ENOMEM;
    87			*fplp = fpl;
    88			fpl->count = 0;
    89			fpl->count_unix = 0;
  > 90			fpl->edges = NULL;
    91			fpl->max = SCM_MAX_FD;
    92			fpl->user = NULL;
    93		}
    94		fpp = &fpl->fp[fpl->count];
    95	
    96		if (fpl->count + num > fpl->max)
    97			return -EINVAL;
    98	
    99		/*
   100		 *	Verify the descriptors and increment the usage count.
   101		 */
   102	
   103		for (i=0; i< num; i++)
   104		{
   105			int fd = fdp[i];
   106			struct file *file;
   107	
   108			if (fd < 0 || !(file = fget_raw(fd)))
   109				return -EBADF;
   110			/* don't allow io_uring files */
   111			if (io_is_uring_fops(file)) {
   112				fput(file);
   113				return -EINVAL;
   114			}
   115			if (unix_get_socket(file))
   116				fpl->count_unix++;
   117	
   118			*fpp++ = file;
   119			fpl->count++;
   120		}
   121	
   122		if (!fpl->user)
   123			fpl->user = get_uid(current_user());
   124	
   125		return num;
   126	}
   127	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help