Commit 5adb6350 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull selinux fix from Paul Moore:
 "A small SELinux patch to resolve a UBSAN warning in the
  xfrm/labeled-IPsec code"

* tag 'selinux-pr-20250618' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
  selinux: fix selinux_xfrm_alloc_user() to set correct ctx_len
parents 5da3ff1f 86c8db86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static int selinux_xfrm_alloc_user(struct xfrm_sec_ctx **ctxp,

	ctx->ctx_doi = XFRM_SC_DOI_LSM;
	ctx->ctx_alg = XFRM_SC_ALG_SELINUX;
	ctx->ctx_len = str_len;
	ctx->ctx_len = str_len + 1;
	memcpy(ctx->ctx_str, &uctx[1], str_len);
	ctx->ctx_str[str_len] = '\0';
	rc = security_context_to_sid(ctx->ctx_str, str_len,