Skip to contentSkip to conversation

proc/proc01.c: ignore stable_secret files

PATCH In review Jeffrey Bastian 2 participants 5 messages Jul 8, 2015 – Jul 9, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 proc/proc01.c: ignore stable_secret files

Linux 4.1.0 introduced a per-NIC IPv6 stable_secret file for RFC7217. The stable_secret file for each NIC cannot be read until it is set, thus LTP fails like this:

proc01      1  TFAIL  :  proc01.c:392: read failed: /proc/sys/net/ipv6/conf/all/stable_secret: errno=EIO(5): Input/output error
proc01      2  TFAIL  :  proc01.c:392: read failed: /proc/sys/net/ipv6/conf/default/stable_secret: errno=EIO(5): Input/output error
proc01      3  TFAIL  :  proc01.c:392: read failed: /proc/sys/net/ipv6/conf/eno1/stable_secret: errno=EIO(5): Input/output error

...

Ignore the stable_secret files in the proc01 test.

TODO: A future test should verify stable_secret functionality.
~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret
cat: /proc/sys/net/ipv6/conf/eno1/stable_secret: Input/output error
~]# echo "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255" > /proc/sys/net/ipv6/conf/eno1/stable_secret ~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

---
 testcases/kernel/fs/proc/proc01.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/fs/proc/proc01.c +3 -2
index f513110eca0e..b9ff3ac42fe2 100644
@@ -290,14 +290,15 @@ static long readproc(const char *obj)
 			     dir_ent != NULL;
 			     dir_ent = (struct dirent *)readdir(dir)) {
 
-				/* Ignore ".", "..", "kcore", and
-				 * "/proc/<pid>" (unless this is our
+				/* Ignore ".", "..", "kcore", "stable_secret",
+                                 * and "/proc/<pid>" (unless this is our
 				 * starting point as directed by the
 				 * user).
 				 */
 				if (strcmp(dir_ent->d_name, ".") &&
 				    strcmp(dir_ent->d_name, "..") &&
 				    strcmp(dir_ent->d_name, "kcore") &&
+				    strcmp(dir_ent->d_name, "stable_secret") &&
 				    (fnmatch("[0-9]*", dir_ent->d_name,
 					     FNM_PATHNAME) ||
 				     strcmp(obj, procpath))) {
Signature · 12 lines
1.9.4

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

----- Original Message -----

Quoted 18 lines

From: "Jeffrey Bastian" <[email protected]>
To: [email protected]
Sent: Wednesday, 8 July, 2015 10:33:58 PM
Subject: [LTP] [PATCH] proc/proc01.c: ignore stable_secret files

Linux 4.1.0 introduced a per-NIC IPv6 stable_secret file for RFC7217. The stable_secret file for each NIC cannot be read until it is set, thus LTP fails like this:

proc01 1 TFAIL : proc01.c:392: read failed:
/proc/sys/net/ipv6/conf/all/stable_secret: errno=EIO(5): Input/output error
proc01 2 TFAIL : proc01.c:392: read failed:
/proc/sys/net/ipv6/conf/default/stable_secret: errno=EIO(5): Input/output error
proc01 3 TFAIL : proc01.c:392: read failed:
/proc/sys/net/ipv6/conf/eno1/stable_secret: errno=EIO(5): Input/output error
...

Quoted 1 line

Ignore the stable_secret files in the proc01 test.

Can we add it to known_issues array instead? It looks like there's no problem with opening/reading the file (in sense that would cause adverse effects, e.g. hang the test).

Regards,
Jan

Quoted 40 lines

TODO: A future test should verify stable_secret functionality.
~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret
cat: /proc/sys/net/ipv6/conf/eno1/stable_secret: Input/output error ~]# echo "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255" > /proc/sys/net/ipv6/conf/eno1/stable_secret
~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

---
 testcases/kernel/fs/proc/proc01.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
testcases/kernel/fs/proc/proc01.c +3 -3
index f513110eca0e..b9ff3ac42fe2 100644
@@ -290,14 +290,15 @@ static long readproc(const char *obj)
 			     dir_ent != NULL;
 			     dir_ent = (struct dirent *)readdir(dir)) {
 
-				/* Ignore ".", "..", "kcore", and
-				 * "/proc/<pid>" (unless this is our
+				/* Ignore ".", "..", "kcore", "stable_secret",
+                                 * and "/proc/<pid>" (unless this is our
 				 * starting point as directed by the
 				 * user).
 				 */
 				if (strcmp(dir_ent->d_name, ".") &&
 				    strcmp(dir_ent->d_name, "..") &&
 				    strcmp(dir_ent->d_name, "kcore") &&
+				    strcmp(dir_ent->d_name, "stable_secret") &&
 				    (fnmatch("[0-9]*", dir_ent->d_name,
 					     FNM_PATHNAME) ||
 				     strcmp(obj, procpath))) {
--

1.9.4

Quoted 11 lines

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 7 lines · Jan Stancek
Quoted 1 line

Ignore the stable_secret files in the proc01 test.

Can we add it to known_issues array instead? It looks like there's no problem
with opening/reading the file (in sense that would cause adverse effects,
e.g. hang the test).

For some reason, I thought the known_issues array could not handle wildcards like '*' when I looked at it last night, but I see now that wildcards are perfectly fine. I'll re-work the patch.

Thanks!
Jeff

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
In reply to Jan Stancek

Linux 4.1.0 introduced a per-NIC IPv6 stable_secret file for RFC7217. The stable_secret file for each NIC cannot be read until it is set, thus LTP fails like this:

proc01      1  TFAIL  :  proc01.c:392: read failed: /proc/sys/net/ipv6/conf/all/stable_secret: errno=EIO(5): Input/output error
proc01      2  TFAIL  :  proc01.c:392: read failed: /proc/sys/net/ipv6/conf/default/stable_secret: errno=EIO(5): Input/output error
proc01      3  TFAIL  :  proc01.c:392: read failed: /proc/sys/net/ipv6/conf/eno1/stable_secret: errno=EIO(5): Input/output error

...

Add the stable_secret files to the known_issues list in the proc01 test.

TODO: A future test should verify stable_secret functionality.
~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret
cat: /proc/sys/net/ipv6/conf/eno1/stable_secret: Input/output error
~]# echo "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255" > /proc/sys/net/ipv6/conf/eno1/stable_secret ~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

---
 testcases/kernel/fs/proc/proc01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/fs/proc/proc01.c +1 -0
index f513110eca0e..2825b51dff95 100644
@@ -107,6 +107,7 @@ static const struct mapping known_issues[] = {
 	{"read", "/proc/fs/nfsd/.getfs", EINVAL},
 	{"read", "/proc/fs/nfsd/.getfd", EINVAL},
 	{"read", "/proc/self/net/rpc/use-gss-proxy", EAGAIN},
+	{"read", "/proc/sys/net/ipv6/conf/*/stable_secret", EIO},
 	{"", "", 0}
 };
 
Signature · 12 lines
1.9.4

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#4 lore raw

----- Original Message -----

Quoted 28 lines

From: "Jeffrey Bastian" <[email protected]>
To: [email protected]
Sent: Thursday, 9 July, 2015 5:14:57 PM
Subject: Re: [LTP] [PATCH v2] proc/proc01.c: ignore stable_secret files

Linux 4.1.0 introduced a per-NIC IPv6 stable_secret file for RFC7217. The stable_secret file for each NIC cannot be read until it is set, thus LTP fails like this:

proc01 1 TFAIL : proc01.c:392: read failed:
/proc/sys/net/ipv6/conf/all/stable_secret: errno=EIO(5): Input/output error
proc01 2 TFAIL : proc01.c:392: read failed:
/proc/sys/net/ipv6/conf/default/stable_secret: errno=EIO(5): Input/output error
proc01 3 TFAIL : proc01.c:392: read failed:
/proc/sys/net/ipv6/conf/eno1/stable_secret: errno=EIO(5): Input/output error
...

Add the stable_secret files to the known_issues list in the proc01 test.

TODO: A future test should verify stable_secret functionality.
~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret
cat: /proc/sys/net/ipv6/conf/eno1/stable_secret: Input/output error ~]# echo "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255" > /proc/sys/net/ipv6/conf/eno1/stable_secret
~]# cat /proc/sys/net/ipv6/conf/eno1/stable_secret ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff

Quoted 1 line

Pushed.

Thanks,
Jan

Quoted 20 lines
---
 testcases/kernel/fs/proc/proc01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/fs/proc/proc01.c +1 -1
index f513110eca0e..2825b51dff95 100644
@@ -107,6 +107,7 @@ static const struct mapping known_issues[] = {
 	{"read", "/proc/fs/nfsd/.getfs", EINVAL},
 	{"read", "/proc/fs/nfsd/.getfd", EINVAL},
 	{"read", "/proc/self/net/rpc/use-gss-proxy", EAGAIN},
+	{"read", "/proc/sys/net/ipv6/conf/*/stable_secret", EIO},
 	{"", "", 0}
 };
 
--

1.9.4

Quoted 11 lines

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list