* [PATCH] also expect EACCES when accept on an established socket
@ 2015-01-15 7:39 Simon Xu
2015-01-15 17:02 ` Daniel Borkmann
0 siblings, 1 reply; 2+ messages in thread
From: Simon Xu @ 2015-01-15 7:39 UTC (permalink / raw)
To: linux-sctp
When SELinux is set to enforcing, errno may be EACCES when accept
on an established socket.
Signed-off-by: Simon Xu <xu.simon@oracle.com>
---
src/func_tests/test_1_to_1_accept_close.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/func_tests/test_1_to_1_accept_close.c b/src/func_tests/test_1_to_1_accept_close.c
index cbb1814..0e9e9c1 100644
--- a/src/func_tests/test_1_to_1_accept_close.c
+++ b/src/func_tests/test_1_to_1_accept_close.c
@@ -175,13 +175,15 @@ main(int argc, char *argv[])
/*Calling accept to establish the connection*/
acpt_sk = test_accept(lstn_sk, (struct sockaddr *) &acpt_addr, &len);
- /*accept() TEST5: On a established socket EINVAL, Expected error*/
+ /*accept() TEST5: On a established socket EINVAL or EACCES when
+ SELinux set to enforcing, Expected error*/
error = accept(acpt_sk, (struct sockaddr *) &acpt_addr, &len);
- if (error != -1 || errno != EINVAL)
+ if (error != -1 || (errno != EINVAL && errno != EACCES)) {
tst_brkm(TBROK, tst_exit, "accept on an established socket"
- "error:%d, errno:%d", error, errno);
+ "error:%d, errno:%d", error, errno);
+ }
- tst_resm(TPASS, "accept() on an established socket - EINVAL");
+ tst_resm(TPASS, "accept() on an established socket - %d", errno);
/*Closing the previously established association*/
close(acpt_sk);
--
2.2.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] also expect EACCES when accept on an established socket
2015-01-15 7:39 [PATCH] also expect EACCES when accept on an established socket Simon Xu
@ 2015-01-15 17:02 ` Daniel Borkmann
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Borkmann @ 2015-01-15 17:02 UTC (permalink / raw)
To: linux-sctp
On 01/15/2015 08:39 AM, Simon Xu wrote:
> When SELinux is set to enforcing, errno may be EACCES when accept
> on an established socket.
>
> Signed-off-by: Simon Xu <xu.simon@oracle.com>
Yep, that's due to a still missing SELinux support, thus it
interprets SCTP as raw sockets.
Applied to lksctp-tools, thanks Simon!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-15 17:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-15 7:39 [PATCH] also expect EACCES when accept on an established socket Simon Xu
2015-01-15 17:02 ` Daniel Borkmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).