linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.27k stars 1k forks source link

clone09.c: EROFS error when open FILE '/proc/sys/net/ipv4/conf/lo/tag' in container env #1083

Open coolgw opened 9 months ago

coolgw commented 9 months ago

Reproduce Step: 1) Using container file create docker img: https://github.com/richiejp/ltp/blob/alpine-container/Containerfile 2) docker run -it --rm xxx /bin/sh 3) run following command /opt/ltp # ./testcases/bin/clone09 tst_test.c:1684: TINFO: LTP version: 20220930-713-g126db850c tst_test.c:1568: TINFO: Timeout per run is 0h 00m 30s clone09.c:59: TINFO: create clone in a new netns with 'CLONE_NEWNET' flag clone09.c:62: TBROK: Failed to open FILE '/proc/sys/net/ipv4/conf/lo/tag' for writing: EROFS (30)

Other info in container: /opt/ltp # ls -l /proc/sys/net/ipv4/conf/lo/tag -rw-r--r-- 1 root root 0 Sep 26 07:02 /proc/sys/net/ipv4/conf/lo/tag /opt/ltp # whoami root /opt/ltp # mount proc on /proc/sys type proc (ro,nosuid,nodev,noexec,relatime)

Martchus commented 9 months ago

Maybe a change similar to what I did for #1082 should be applied here as well?

coolgw commented 9 months ago

Maybe a change similar to what I did for #1082 should be applied here as well? I suggest wait @pevik @richiejp 's feedback, change code or tune the setup of container etc..

coolgw commented 9 months ago

Just FYI @Martchus
Following patch change the container's setup and use normal user instead of root, then if you run case with normal user the error will not happen. https://patchwork.ozlabs.org/project/ltp/patch/20230926090101.7565-1-rpalethorpe@suse.com/

coolgw commented 1 month ago

Just FYI @Martchus Following patch change the container's setup and use normal user instead of root, then if you run case with normal user the error will not happen. https://patchwork.ozlabs.org/project/ltp/patch/20230926090101.7565-1-rpalethorpe@suse.com/

https://patchwork.ozlabs.org/project/ltp/patch/20231009102405.26471-1-rpalethorpe@suse.com/ merge in LTP.