[jsarha:topic/chromeos-4.19-s0ix 7414/9999] security/container/process.c:44:31: error: 'struct linux_binprm' has no member named 'vma'

From: kernel test robot
Date: Thu Jul 28 2022 - 12:46:38 EST


tree: https://github.com/jsarha/linux topic/chromeos-4.19-s0ix
head: 430bdaa0a8c38697780f45a148964d71951df11f
commit: 92dff21f44ad18e109b6e086a29141fe474b3782 [7414/9999] CHROMIUM: security: Container Monitoring LSM
config: sh-randconfig-c041-20220728 (https://download.01.org/0day-ci/archive/20220729/202207290033.VXKH5hwO-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 12.1.0
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/jsarha/linux/commit/92dff21f44ad18e109b6e086a29141fe474b3782
git remote add jsarha https://github.com/jsarha/linux
git fetch --no-tags jsarha topic/chromeos-4.19-s0ix
git checkout 92dff21f44ad18e109b6e086a29141fe474b3782
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash security/container/

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

All errors (new ones prefixed by >>):

security/container/process.c: In function 'kmap_argument_stack':
>> security/container/process.c:44:31: error: 'struct linux_binprm' has no member named 'vma'
44 | count = vma_pages(bprm->vma);
| ^~
In file included from include/linux/kernel.h:10,
from security/container/monitor.h:10,
from security/container/process.c:8:
security/container/process.c: In function 'kunmap_argument_stack':
security/container/process.c:93:34: error: 'struct linux_binprm' has no member named 'vma'
93 | if (likely(vma_pages(bprm->vma) == 1)) {
| ^~
include/linux/compiler.h:76:45: note: in definition of macro 'likely'
76 | # define likely(x) __builtin_expect(!!(x), 1)
| ^
security/container/process.c: In function 'encode_current_argv':
security/container/process.c:150:43: error: 'struct linux_binprm' has no member named 'vma'
150 | unsigned long end = vma_pages(bprm->vma) * PAGE_SIZE;
| ^~
security/container/process.c: In function 'encode_current_envp':
security/container/process.c:234:43: error: 'struct linux_binprm' has no member named 'vma'
234 | unsigned long end = vma_pages(bprm->vma) * PAGE_SIZE;
| ^~
security/container/process.c: At top level:
security/container/process.c:367:5: warning: no previous prototype for 'csm_set_contid' [-Wmissing-prototypes]
367 | u64 csm_set_contid(struct task_struct *task)
| ^~~~~~~~~~~~~~


vim +44 security/container/process.c

34
35 static void *kmap_argument_stack(struct linux_binprm *bprm, void **ctx)
36 {
37 char *argv;
38 int err;
39 unsigned long i, pos, count;
40 void *map;
41 struct page *page;
42
43 /* vma_pages() returns the number of pages reserved for the stack */
> 44 count = vma_pages(bprm->vma);
45
46 if (likely(count == 1)) {
47 err = get_user_pages_remote(current, bprm->mm, bprm->p, 1,
48 FOLL_FORCE, &page, NULL, NULL);
49 if (err != 1)
50 return NULL;
51
52 argv = kmap(page);
53 *ctx = page;
54 } else {
55 /*
56 * If more than one pages is needed, copy all of them to a set
57 * of pages. Parsing the argument across kmap pages in different
58 * addresses would make it impractical.
59 */
60 argv = vmalloc(count * PAGE_SIZE);
61 if (!argv)
62 return NULL;
63
64 for (i = 0; i < count; i++) {
65 pos = ALIGN_DOWN(bprm->p, PAGE_SIZE) + i * PAGE_SIZE;
66 err = get_user_pages_remote(current, bprm->mm, pos, 1,
67 FOLL_FORCE, &page, NULL,
68 NULL);
69 if (err <= 0) {
70 vfree(argv);
71 return NULL;
72 }
73
74 map = kmap(page);
75 memcpy(argv + i * PAGE_SIZE, map, PAGE_SIZE);
76 kunmap(page);
77 put_page(page);
78 }
79 *ctx = bprm;
80 }
81
82 return argv;
83 }
84

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