[CRIU] [PATCH] restore: Compute auxv size taking into account kernel's mm::saved_auxv type
Cyrill Gorcunov
gorcunov at gmail.com
Mon Feb 10 03:53:19 PST 2014
On Mon, Feb 10, 2014 at 03:22:16PM +0400, Pavel Emelyanov wrote:
> On 02/10/2014 03:15 PM, Cyrill Gorcunov wrote:
> > On 32-bit ARM machine we've got:
> >
> > | 10:45:28.595: 4927: new environ: GIT_URL=git://git.criu.org/crtools.git
> > | 10:45:28.595: 4927: FAIL: cmdlinenv00.c:116: auxv corrupted on restore (errno = 11 (Resource temporarily unavailable))
> >
> > that's because in commit 459828b6bec92d664bcce8419436e528be2094f2
> > we've changed reading procedure of auxv but forgot to update
> > restore procedure (which were thinking that size of vector
> > remains in number of "passes".
>
> IOW, we broke backward compatibility, right?
Yes, sort of. When I've converted this read in 459828b6 I missed
the key point
- for (i = 0; i < AT_VECTOR_SIZE; i++) {
- ret = read(fd, &mm->mm_saved_auxv[i],
- sizeof(auxv_t)); <--
- if (ret == 0)
- break;
- else if (ret != sizeof(auxv_t)) {
- ret = -1;
- pr_perror("Error reading %d's auxv[%d]",
- pid, i);
- goto err;
- }
- }
sizeof(auxv_t) is different between 32bit and 64bit.
More information about the CRIU
mailing list