[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202501190149.qVdSAbjh-lkp@intel.com>
Date: Sun, 19 Jan 2025 01:31:49 +0800
From: kernel test robot <lkp@...el.com>
To: Deven Bowers <deven.desai@...ux.microsoft.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
Paul Moore <paul@...l-moore.com>,
Fan Wu <wufan@...ux.microsoft.com>
Subject: security/ipe/hooks.c:52: warning: Function parameter or struct
member '__always_unused' not described in 'ipe_mmap_file'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 595523945be0a5a2f12a1c04772383293fbc04a1
commit: 52443cb60c356707df494910fa134bbb0a8b1a66 ipe: add LSM hooks on execution and kernel read
date: 5 months ago
config: sh-allyesconfig (https://download.01.org/0day-ci/archive/20250119/202501190149.qVdSAbjh-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250119/202501190149.qVdSAbjh-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501190149.qVdSAbjh-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> security/ipe/hooks.c:52: warning: Function parameter or struct member '__always_unused' not described in 'ipe_mmap_file'
>> security/ipe/hooks.c:52: warning: Excess function parameter 'reqprot' description in 'ipe_mmap_file'
>> security/ipe/hooks.c:80: warning: Function parameter or struct member '__always_unused' not described in 'ipe_file_mprotect'
>> security/ipe/hooks.c:80: warning: Excess function parameter 'reqprot' description in 'ipe_file_mprotect'
vim +52 security/ipe/hooks.c
34
35 /**
36 * ipe_mmap_file() - ipe security hook function for mmap check.
37 * @f: File being mmap'd. Can be NULL in the case of anonymous memory.
38 * @reqprot: The requested protection on the mmap, passed from usermode.
39 * @prot: The effective protection on the mmap, resolved from reqprot and
40 * system configuration.
41 * @flags: Unused.
42 *
43 * This hook is called when a file is loaded through the mmap
44 * family of system calls.
45 *
46 * Return:
47 * * %0 - Success
48 * * %-EACCES - Did not pass IPE policy
49 */
50 int ipe_mmap_file(struct file *f, unsigned long reqprot __always_unused,
51 unsigned long prot, unsigned long flags)
> 52 {
53 struct ipe_eval_ctx ctx = IPE_EVAL_CTX_INIT;
54
55 if (prot & PROT_EXEC) {
56 ipe_build_eval_ctx(&ctx, f, IPE_OP_EXEC);
57 return ipe_evaluate_event(&ctx);
58 }
59
60 return 0;
61 }
62
63 /**
64 * ipe_file_mprotect() - ipe security hook function for mprotect check.
65 * @vma: Existing virtual memory area created by mmap or similar.
66 * @reqprot: The requested protection on the mmap, passed from usermode.
67 * @prot: The effective protection on the mmap, resolved from reqprot and
68 * system configuration.
69 *
70 * This LSM hook is called when a mmap'd region of memory is changing
71 * its protections via mprotect.
72 *
73 * Return:
74 * * %0 - Success
75 * * %-EACCES - Did not pass IPE policy
76 */
77 int ipe_file_mprotect(struct vm_area_struct *vma,
78 unsigned long reqprot __always_unused,
79 unsigned long prot)
> 80 {
81 struct ipe_eval_ctx ctx = IPE_EVAL_CTX_INIT;
82
83 /* Already Executable */
84 if (vma->vm_flags & VM_EXEC)
85 return 0;
86
87 if (prot & PROT_EXEC) {
88 ipe_build_eval_ctx(&ctx, vma->vm_file, IPE_OP_EXEC);
89 return ipe_evaluate_event(&ctx);
90 }
91
92 return 0;
93 }
94
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists