linux-next: manual merge of the security tree with the mm tree

Stephen Rothwell posted 1 patch 1 month, 1 week ago
There is a newer version of this series
linux-next: manual merge of the security tree with the mm tree
Posted by Stephen Rothwell 1 month, 1 week ago
Hi all,

Today's linux-next merge of the security tree got a conflict in:

  kernel/auditsc.c

between commit:

  cd39427be833 ("auditsc: replace memcpy() with strscpy()")

from the mm-nonmm-unstable branch of the mm tree and commits:

  37f670aacd48 ("lsm: use lsm_prop in security_current_getsecid")
  13d826e564e2 ("audit: change context data from secid to lsm_prop")

from the security tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc kernel/auditsc.c
index 7adc67d5aafb,f28fd513d047..000000000000
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@@ -2729,8 -2728,8 +2728,8 @@@ void __audit_ptrace(struct task_struct 
  	context->target_auid = audit_get_loginuid(t);
  	context->target_uid = task_uid(t);
  	context->target_sessionid = audit_get_sessionid(t);
- 	security_task_getsecid_obj(t, &context->target_sid);
+ 	security_task_getlsmprop_obj(t, &context->target_ref);
 -	memcpy(context->target_comm, t->comm, TASK_COMM_LEN);
 +	strscpy(context->target_comm, t->comm);
  }
  
  /**
@@@ -2756,8 -2755,8 +2755,8 @@@ int audit_signal_info_syscall(struct ta
  		ctx->target_auid = audit_get_loginuid(t);
  		ctx->target_uid = t_uid;
  		ctx->target_sessionid = audit_get_sessionid(t);
- 		security_task_getsecid_obj(t, &ctx->target_sid);
+ 		security_task_getlsmprop_obj(t, &ctx->target_ref);
 -		memcpy(ctx->target_comm, t->comm, TASK_COMM_LEN);
 +		strscpy(ctx->target_comm, t->comm);
  		return 0;
  	}
  
@@@ -2777,8 -2776,8 +2776,8 @@@
  	axp->target_auid[axp->pid_count] = audit_get_loginuid(t);
  	axp->target_uid[axp->pid_count] = t_uid;
  	axp->target_sessionid[axp->pid_count] = audit_get_sessionid(t);
- 	security_task_getsecid_obj(t, &axp->target_sid[axp->pid_count]);
+ 	security_task_getlsmprop_obj(t, &axp->target_ref[axp->pid_count]);
 -	memcpy(axp->target_comm[axp->pid_count], t->comm, TASK_COMM_LEN);
 +	strscpy(axp->target_comm[axp->pid_count], t->comm);
  	axp->pid_count++;
  
  	return 0;
Re: linux-next: manual merge of the security tree with the mm tree
Posted by Stephen Rothwell 6 days, 23 hours ago
Hi all,

On Mon, 14 Oct 2024 14:46:48 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the security tree got a conflict in:
> 
>   kernel/auditsc.c
> 
> between commit:
> 
>   cd39427be833 ("auditsc: replace memcpy() with strscpy()")
> 
> from the mm-nonmm-unstable branch of the mm tree and commits:
> 
>   37f670aacd48 ("lsm: use lsm_prop in security_current_getsecid")
>   13d826e564e2 ("audit: change context data from secid to lsm_prop")
> 
> from the security tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> diff --cc kernel/auditsc.c
> index 7adc67d5aafb,f28fd513d047..000000000000
> --- a/kernel/auditsc.c
> +++ b/kernel/auditsc.c
> @@@ -2729,8 -2728,8 +2728,8 @@@ void __audit_ptrace(struct task_struct 
>   	context->target_auid = audit_get_loginuid(t);
>   	context->target_uid = task_uid(t);
>   	context->target_sessionid = audit_get_sessionid(t);
> - 	security_task_getsecid_obj(t, &context->target_sid);
> + 	security_task_getlsmprop_obj(t, &context->target_ref);
>  -	memcpy(context->target_comm, t->comm, TASK_COMM_LEN);
>  +	strscpy(context->target_comm, t->comm);
>   }
>   
>   /**
> @@@ -2756,8 -2755,8 +2755,8 @@@ int audit_signal_info_syscall(struct ta
>   		ctx->target_auid = audit_get_loginuid(t);
>   		ctx->target_uid = t_uid;
>   		ctx->target_sessionid = audit_get_sessionid(t);
> - 		security_task_getsecid_obj(t, &ctx->target_sid);
> + 		security_task_getlsmprop_obj(t, &ctx->target_ref);
>  -		memcpy(ctx->target_comm, t->comm, TASK_COMM_LEN);
>  +		strscpy(ctx->target_comm, t->comm);
>   		return 0;
>   	}
>   
> @@@ -2777,8 -2776,8 +2776,8 @@@
>   	axp->target_auid[axp->pid_count] = audit_get_loginuid(t);
>   	axp->target_uid[axp->pid_count] = t_uid;
>   	axp->target_sessionid[axp->pid_count] = audit_get_sessionid(t);
> - 	security_task_getsecid_obj(t, &axp->target_sid[axp->pid_count]);
> + 	security_task_getlsmprop_obj(t, &axp->target_ref[axp->pid_count]);
>  -	memcpy(axp->target_comm[axp->pid_count], t->comm, TASK_COMM_LEN);
>  +	strscpy(axp->target_comm[axp->pid_count], t->comm);
>   	axp->pid_count++;
>   
>   	return 0;

This is now a conflict between the mm-nonmm-stable tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell