public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* security/ipe/hooks.c:52: warning: Function parameter or struct member '__always_unused' not described in 'ipe_mmap_file'
@ 2025-01-18 17:31 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-01-18 17:31 UTC (permalink / raw)
  To: Deven Bowers; +Cc: oe-kbuild-all, linux-kernel, Paul Moore, Fan Wu

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@intel.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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* security/ipe/hooks.c:52: warning: Function parameter or struct member '__always_unused' not described in 'ipe_mmap_file'
@ 2025-02-12  4:52 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-02-12  4:52 UTC (permalink / raw)
  To: Deven Bowers; +Cc: oe-kbuild-all, linux-kernel, Paul Moore, Fan Wu

Hi Deven,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   09fbf3d502050282bf47ab3babe1d4ed54dd1fd8
commit: 52443cb60c356707df494910fa134bbb0a8b1a66 ipe: add LSM hooks on execution and kernel read
date:   6 months ago
config: i386-allmodconfig (https://download.01.org/0day-ci/archive/20250212/202502121207.AtcCkAj0-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250212/202502121207.AtcCkAj0-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/202502121207.AtcCkAj0-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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-12  4:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-18 17:31 security/ipe/hooks.c:52: warning: Function parameter or struct member '__always_unused' not described in 'ipe_mmap_file' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-02-12  4:52 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox