From b7cebee89e22ad8358fa1dcca1ef2ffb46f4cd1d Mon Sep 17 00:00:00 2001 From: lmagyar Date: Mon, 26 Nov 2018 21:29:41 +0100 Subject: [PATCH] SecurityContextCallableProcessingInterceptor thread visibility fix Within class SecurityContextCallableProcessingInterceptor field securityContext should volatile. Fixes gh-6143 --- .../async/SecurityContextCallableProcessingInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/context/request/async/SecurityContextCallableProcessingInterceptor.java b/web/src/main/java/org/springframework/security/web/context/request/async/SecurityContextCallableProcessingInterceptor.java index 374edd6245..a1c3f0ab68 100644 --- a/web/src/main/java/org/springframework/security/web/context/request/async/SecurityContextCallableProcessingInterceptor.java +++ b/web/src/main/java/org/springframework/security/web/context/request/async/SecurityContextCallableProcessingInterceptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ import org.springframework.web.context.request.async.CallableProcessingIntercept */ public final class SecurityContextCallableProcessingInterceptor extends CallableProcessingInterceptorAdapter { - private SecurityContext securityContext; + private volatile SecurityContext securityContext; /** * Create a new {@link SecurityContextCallableProcessingInterceptor} that uses the