All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v25 23/25] Audit: Add a new record for multiple object LSM attributes
@ 2021-03-10 21:13 kernel test robot
  0 siblings, 0 replies; 70+ messages in thread
From: kernel test robot @ 2021-03-10 21:13 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5769 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210309144243.12519-24-casey@schaufler-ca.com>
References: <20210309144243.12519-24-casey@schaufler-ca.com>
TO: Casey Schaufler <casey@schaufler-ca.com>
TO: casey.schaufler(a)intel.com
TO: jmorris(a)namei.org
TO: linux-security-module(a)vger.kernel.org
TO: selinux(a)vger.kernel.org
CC: casey(a)schaufler-ca.com
CC: linux-audit(a)redhat.com
CC: keescook(a)chromium.org
CC: john.johansen(a)canonical.com
CC: penguin-kernel(a)i-love.sakura.ne.jp
CC: paul(a)paul-moore.com

Hi Casey,

I love your patch! Perhaps something to improve:

[auto build test WARNING on nf/master]
[also build test WARNING on linus/master v5.12-rc2]
[cannot apply to pcmoore-audit/next nf-next/master security/next-testing]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Casey-Schaufler/LSM-Infrastructure-management-of-the-sock-security/20210309-234224
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf.git master
:::::: branch date: 30 hours ago
:::::: commit date: 30 hours ago
config: x86_64-randconfig-m001-20210308 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
kernel/audit.c:2197 audit_log_object_context() warn: we never enter this loop

Old smatch warnings:
include/linux/security.h:199 lsmblob_init() warn: we never enter this loop

vim +2197 kernel/audit.c

b24a30a7305418 Eric Paris      2013-04-30  2173  
853cbd89b58a60 Casey Schaufler 2021-03-09  2174  int audit_log_object_context(struct audit_buffer *ab,
853cbd89b58a60 Casey Schaufler 2021-03-09  2175  				    struct lsmblob *blob)
853cbd89b58a60 Casey Schaufler 2021-03-09  2176  {
853cbd89b58a60 Casey Schaufler 2021-03-09  2177  	int i;
853cbd89b58a60 Casey Schaufler 2021-03-09  2178  	int error;
853cbd89b58a60 Casey Schaufler 2021-03-09  2179  	bool sep = false;
853cbd89b58a60 Casey Schaufler 2021-03-09  2180  	struct lsmcontext lsmdata;
853cbd89b58a60 Casey Schaufler 2021-03-09  2181  	struct audit_buffer *lsmab = NULL;
853cbd89b58a60 Casey Schaufler 2021-03-09  2182  	struct audit_context *context = NULL;
853cbd89b58a60 Casey Schaufler 2021-03-09  2183  
853cbd89b58a60 Casey Schaufler 2021-03-09  2184  	/*
853cbd89b58a60 Casey Schaufler 2021-03-09  2185  	 * If there is more than one security module that has a
853cbd89b58a60 Casey Schaufler 2021-03-09  2186  	 * object "context" it's necessary to put the object data
853cbd89b58a60 Casey Schaufler 2021-03-09  2187  	 * into a separate record to maintain compatibility.
853cbd89b58a60 Casey Schaufler 2021-03-09  2188  	 */
853cbd89b58a60 Casey Schaufler 2021-03-09  2189  	if (lsm_multiple_contexts()) {
853cbd89b58a60 Casey Schaufler 2021-03-09  2190  		audit_log_format(ab, " obj=?");
853cbd89b58a60 Casey Schaufler 2021-03-09  2191  		context = ab->ctx;
853cbd89b58a60 Casey Schaufler 2021-03-09  2192  		if (context)
853cbd89b58a60 Casey Schaufler 2021-03-09  2193  			lsmab = audit_log_start(context, GFP_KERNEL,
853cbd89b58a60 Casey Schaufler 2021-03-09  2194  						AUDIT_MAC_OBJ_CONTEXTS);
853cbd89b58a60 Casey Schaufler 2021-03-09  2195  	}
853cbd89b58a60 Casey Schaufler 2021-03-09  2196  
853cbd89b58a60 Casey Schaufler 2021-03-09 @2197  	for (i = 0; i < LSMBLOB_ENTRIES; i++) {
853cbd89b58a60 Casey Schaufler 2021-03-09  2198  		if (blob->secid[i] == 0)
853cbd89b58a60 Casey Schaufler 2021-03-09  2199  			continue;
853cbd89b58a60 Casey Schaufler 2021-03-09  2200  		error = security_secid_to_secctx(blob, &lsmdata, i);
853cbd89b58a60 Casey Schaufler 2021-03-09  2201  		if (error && error != -EINVAL) {
853cbd89b58a60 Casey Schaufler 2021-03-09  2202  			audit_panic("error in audit_log_object_context");
853cbd89b58a60 Casey Schaufler 2021-03-09  2203  			return error;
853cbd89b58a60 Casey Schaufler 2021-03-09  2204  		}
853cbd89b58a60 Casey Schaufler 2021-03-09  2205  
853cbd89b58a60 Casey Schaufler 2021-03-09  2206  		if (context) {
853cbd89b58a60 Casey Schaufler 2021-03-09  2207  			audit_log_format(lsmab, "%sobj_%s=%s",
853cbd89b58a60 Casey Schaufler 2021-03-09  2208  					 sep ? " " : "",
853cbd89b58a60 Casey Schaufler 2021-03-09  2209  					 lsm_slot_to_name(i),
853cbd89b58a60 Casey Schaufler 2021-03-09  2210  					 lsmdata.context);
853cbd89b58a60 Casey Schaufler 2021-03-09  2211  			sep = true;
853cbd89b58a60 Casey Schaufler 2021-03-09  2212  		} else
853cbd89b58a60 Casey Schaufler 2021-03-09  2213  			audit_log_format(ab, " obj=%s", lsmdata.context);
853cbd89b58a60 Casey Schaufler 2021-03-09  2214  
853cbd89b58a60 Casey Schaufler 2021-03-09  2215  		security_release_secctx(&lsmdata);
853cbd89b58a60 Casey Schaufler 2021-03-09  2216  		if (!context)
853cbd89b58a60 Casey Schaufler 2021-03-09  2217  			break;
853cbd89b58a60 Casey Schaufler 2021-03-09  2218  	}
853cbd89b58a60 Casey Schaufler 2021-03-09  2219  
853cbd89b58a60 Casey Schaufler 2021-03-09  2220  	if (context)
853cbd89b58a60 Casey Schaufler 2021-03-09  2221  		audit_log_end(lsmab);
853cbd89b58a60 Casey Schaufler 2021-03-09  2222  
853cbd89b58a60 Casey Schaufler 2021-03-09  2223  	return 0;
853cbd89b58a60 Casey Schaufler 2021-03-09  2224  }
853cbd89b58a60 Casey Schaufler 2021-03-09  2225  EXPORT_SYMBOL(audit_log_object_context);
853cbd89b58a60 Casey Schaufler 2021-03-09  2226  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31463 bytes --]

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

end of thread, other threads:[~2021-03-12 21:29 UTC | newest]

Thread overview: 70+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210309144243.12519-1-casey.ref@schaufler-ca.com>
2021-03-09 14:42 ` [PATCH v25 00/25] LSM: Module stacking for AppArmor Casey Schaufler
2021-03-09 14:42   ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 01/25] LSM: Infrastructure management of the sock security Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 02/25] LSM: Add the lsmblob data structure Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 03/25] LSM: provide lsm name and id slot mappings Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 04/25] IMA: avoid label collisions with stacked LSMs Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 05/25] LSM: Use lsmblob in security_audit_rule_match Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 06/25] LSM: Use lsmblob in security_kernel_act_as Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 07/25] LSM: Use lsmblob in security_secctx_to_secid Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 08/25] LSM: Use lsmblob in security_secid_to_secctx Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 09/25] LSM: Use lsmblob in security_ipc_getsecid Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 10/25] LSM: Use lsmblob in security_task_getsecid Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 11/25] LSM: Use lsmblob in security_inode_getsecid Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 12/25] LSM: Use lsmblob in security_cred_getsecid Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 19:46     ` kernel test robot
2021-03-09 19:46       ` kernel test robot
2021-03-09 19:46       ` kernel test robot
2021-03-09 19:46     ` [RFC PATCH] LSM: audit_sig_lsm can be static kernel test robot
2021-03-09 19:46       ` kernel test robot
2021-03-09 19:46       ` kernel test robot
2021-03-09 14:42   ` [PATCH v25 13/25] IMA: Change internal interfaces to use lsmblobs Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 14/25] LSM: Specify which LSM to display Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 15/25] LSM: Ensure the correct LSM context releaser Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 16/25] LSM: Use lsmcontext in security_secid_to_secctx Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 17/25] LSM: Use lsmcontext in security_inode_getsecctx Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-12 16:16     ` Chuck Lever III
2021-03-12 16:16       ` Chuck Lever III
2021-03-09 14:42   ` [PATCH v25 18/25] LSM: security_secid_to_secctx in netlink netfilter Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 19/25] NET: Store LSM netlabel data in a lsmblob Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 20/25] LSM: Verify LSM display sanity in binder Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 21/25] audit: add support for non-syscall auxiliary records Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 17:55     ` kernel test robot
2021-03-09 17:55       ` kernel test robot
2021-03-09 17:55       ` kernel test robot
2021-03-09 14:42   ` [PATCH v25 22/25] Audit: Add new record for multiple process LSM attributes Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 17:04     ` kernel test robot
2021-03-09 17:04       ` kernel test robot
2021-03-09 17:04       ` kernel test robot
2021-03-09 17:19     ` kernel test robot
2021-03-09 17:19       ` kernel test robot
2021-03-09 17:19       ` kernel test robot
2021-03-09 14:42   ` [PATCH v25 23/25] Audit: Add a new record for multiple object " Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 24/25] LSM: Add /proc attr entry for full LSM context Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-09 14:42   ` [PATCH v25 25/25] AppArmor: Remove the exclusive flag Casey Schaufler
2021-03-09 14:42     ` Casey Schaufler
2021-03-10 21:13 [PATCH v25 23/25] Audit: Add a new record for multiple object LSM attributes 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.