[CRIU] failure dumping nginx in docker container

Pavel Emelyanov xemul at parallels.com
Wed Jul 15 03:55:51 PDT 2015


On 07/14/2015 10:35 PM, Cyrill Gorcunov wrote:
> On Tue, Jul 14, 2015 at 12:32:33PM -0700, Ross Boucher wrote:
>>    Cyrill sent me a patch to test, and the combination of that patch and
>>    avagin's patch results in a new failure:
>>    https://gist.github.com/boucher/ad218608dcdbd0f178fa
> 
> Heh
> 
> unsigned long rst_mem_cpos(int type)
> {
> 	struct rst_mem_type_s *t = &rst_mems[type];
> 	BUG_ON(!t->remapable || !t->enabled);
> 	return t->free_mem - t->buf;
> }
> 
> 
> Pavel?
> .
> 

I guess it's due to this piece of code from sigreturn_restore():

       if (lsm) {
                char *rendered;
                int ret;

                ret = render_lsm_profile(lsm, &rendered);
                xfree(lsm);
                if (ret < 0) {
                        goto err_nv;
                }

                lsm_pos = rst_mem_cpos(RM_PRIVATE);
                lsm_profile_len = strlen(rendered);
                lsm = rst_mem_alloc(lsm_profile_len + 1, RM_PRIVATE);
                if (!lsm) {
                        xfree(rendered);
                        goto err_nv;
                }

                strncpy(lsm, rendered, lsm_profile_len);
                xfree(rendered);

        }

No rst_mem_alloc()-s and rst_mem_cpos()-s are allowed after rst_mem_lock()
since the restorer area is already allocated and new data cannot fit into
it.

I'll try to cook a patch for it too :)

-- Pavel


More information about the CRIU mailing list