ltp icon indicating copy to clipboard operation
ltp copied to clipboard

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

Open coolgw opened this issue 1 year ago • 4 comments

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)

coolgw avatar Sep 26 '23 08:09 coolgw

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

Martchus avatar Sep 26 '23 08:09 Martchus

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 avatar Sep 26 '23 08:09 coolgw

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/[email protected]/

coolgw avatar Sep 27 '23 01:09 coolgw

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/[email protected]/

https://patchwork.ozlabs.org/project/ltp/patch/[email protected]/ merge in LTP.

coolgw avatar May 28 '24 09:05 coolgw