seccomp: Don't exit from __export_restore_thread

Submitted by Cyrill Gorcunov on May 16, 2018, 8:46 a.m.

Details

Message ID 20180516084659.27943-1-gorcunov@gmail.com
State Accepted
Series "seccomp: Don't exit from __export_restore_thread"
Commit 2a63e3983b36a139056d5f42011560567a8680c1
Headers show

Commit Message

Cyrill Gorcunov May 16, 2018, 8:46 a.m.
After CR_STATE_RESTORE_SIGCHLD stage triggered we are
not allowed to exit, just yield the BUG instead.

Reported-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 criu/pie/restorer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
index fbdec0bca01c..9b7f6ddbee7b 100644
--- a/criu/pie/restorer.c
+++ b/criu/pie/restorer.c
@@ -588,13 +588,13 @@  long __export_restore_thread(struct thread_restore_args *args)
 	 * operation bound to uid 0 in current user ns.
 	 */
 	if (restore_seccomp(args))
-		goto core_restore_end;
+		BUG();
 
 	ret = restore_creds(args->creds_args, args->ta->proc_fd);
 	ret = ret || restore_dumpable_flag(&args->ta->mm);
 	ret = ret || restore_pdeath_sig(args);
 	if (ret)
-		goto core_restore_end;
+		BUG();
 
 	restore_finish_stage(task_entries_local, CR_STATE_RESTORE_CREDS);
 

Comments

Andrei Vagin May 24, 2018, 9:28 p.m.
Applied, thanks
On Wed, May 16, 2018 at 11:46:59AM +0300, Cyrill Gorcunov wrote:
> After CR_STATE_RESTORE_SIGCHLD stage triggered we are
> not allowed to exit, just yield the BUG instead.
> 
> Reported-by: Andrei Vagin <avagin@virtuozzo.com>
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> ---
>  criu/pie/restorer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
> index fbdec0bca01c..9b7f6ddbee7b 100644
> --- a/criu/pie/restorer.c
> +++ b/criu/pie/restorer.c
> @@ -588,13 +588,13 @@ long __export_restore_thread(struct thread_restore_args *args)
>  	 * operation bound to uid 0 in current user ns.
>  	 */
>  	if (restore_seccomp(args))
> -		goto core_restore_end;
> +		BUG();
>  
>  	ret = restore_creds(args->creds_args, args->ta->proc_fd);
>  	ret = ret || restore_dumpable_flag(&args->ta->mm);
>  	ret = ret || restore_pdeath_sig(args);
>  	if (ret)
> -		goto core_restore_end;
> +		BUG();
>  
>  	restore_finish_stage(task_entries_local, CR_STATE_RESTORE_CREDS);
>  
> -- 
> 2.14.3
>
Cyrill Gorcunov May 24, 2018, 9:36 p.m.
On Thu, May 24, 2018 at 02:28:28PM -0700, Andrey Vagin wrote:
> Applied, thanks

I've sent another version as well, but sine you already applied
this one it is fine, drop another one.