Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 256825 - net-misc/rsync sandbox access violation and memory corruption on Gentoo/FreeBSD.
Summary: net-misc/rsync sandbox access violation and memory corruption on Gentoo/FreeBSD.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: High normal (vote)
Assignee: Sandbox Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-29 19:38 UTC by Javier Villavicencio (RETIRED)
Modified: 2009-01-30 04:15 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
rsync's config.log (config.log,256.97 KB, text/plain)
2009-01-29 19:40 UTC, Javier Villavicencio (RETIRED)
Details
sandbox log of the access violation (sandbox-68982.log,563 bytes, text/plain)
2009-01-29 19:41 UTC, Javier Villavicencio (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Javier Villavicencio (RETIRED) gentoo-dev 2009-01-29 19:38:13 UTC
Using sys-apps/sandbox-1.3.3 (also happens with 1.3.2) while net-misc/rsync-3.0.5 merge
During rsync's configure phase:

configure.sh:15970: checking if mknod creates FIFOs
configure.sh:16000: i686-gentoo-freebsd7.1-gcc -std=gnu99 -o conftest -march=k8 -O2 -pipe -DHAVE_CONFIG_H -Wall -W   conftest.c -lpopt -liconv  >&5
configure.sh:16009: ./conftest
ACCESS DENIED  mknod:     /var/tmp/portage/net-misc/rsync-3.0.5/work/rsync-3.0.5/fifo-test
sandbox memory corruption free(0x28301030): Invalid argument
[ the program that fails: ]
| #include <stdio.h>
| #include <sys/stat.h>
| #include <errno.h>
| main() { int rc, ec; char *fn = "fifo-test";
| unlink(fn); rc = mknod(fn,S_IFIFO,0600); ec = errno; unlink(fn);
| if (rc) {printf("(%d %d) ",rc,ec); return ec;}
| return 0;}

After the mknod/FIFO check the socket check:

configure.sh:16038: checking if mknod creates sockets
configure.sh:16068: i686-gentoo-freebsd7.1-gcc -std=gnu99 -o conftest -march=k8 -O2 -pipe -DHAVE_CONFIG_H -Wall -W   conftest.c -lpopt -liconv  >&5
configure.sh:16077: ./conftest
ACCESS DENIED  mknod:     /var/tmp/portage/net-misc/rsync-3.0.5/work/rsync-3.0.5/sock-test
sandbox memory corruption free(0x28301030): Invalid argument
[ program that fails: ]
| #include <stdio.h>
| #include <sys/stat.h>
| #include <errno.h>
| main() { int rc, ec; char *fn = "sock-test";
| unlink(fn); rc = mknod(fn,S_IFSOCK,0600); ec = errno; unlink(fn);
| if (rc) {printf("(%d %d) ",rc,ec); return ec;}
| return 0;}

And then rsync finishes compiling (with mknod/fifo|socket=no).
Comment 1 Javier Villavicencio (RETIRED) gentoo-dev 2009-01-29 19:40:21 UTC
Created attachment 180151 [details]
rsync's config.log
Comment 2 Javier Villavicencio (RETIRED) gentoo-dev 2009-01-29 19:41:56 UTC
Created attachment 180153 [details]
sandbox log of the access violation
Comment 3 SpanKY gentoo-dev 2009-01-29 22:46:26 UTC
there is a commented out line in libsandbox.c that checks for SB_NR_MKNOD ... can you see if removing that commented line fixes things ?
Comment 4 Javier Villavicencio (RETIRED) gentoo-dev 2009-01-30 02:16:37 UTC
(In reply to comment #3)
> there is a commented out line in libsandbox.c that checks for SB_NR_MKNOD ...
> can you see if removing that commented line fixes things ?
> 

Yep, uncommenting
libsandbox.c:618:           sb_nr == SB_NR_MKNOD       ||
Lets rsync merge successfully. Tested it using 1.3.3.

/OT
By the way, ssh to "alniyat" after you get into that box. The quad phenom > that p2-450.
Comment 5 SpanKY gentoo-dev 2009-01-30 04:15:22 UTC
yeah, i dropped that because it isnt available on linux by default, but that's changed since for other porting reasons, so ...

http://git.overlays.gentoo.org/gitweb/?p=proj/sandbox.git;a=commitdiff;h=c688d9325b44f2593a425236da5f5dc1fea09c24