Bug 740503

Summary: [SCTP] Permission denied on a established socket via root
Product: Red Hat Enterprise Linux 6 Reporter: Hangbin Liu <haliu>
Component: kernelAssignee: Thomas Graf <tgraf>
Status: CLOSED DUPLICATE QA Contact: Network QE <network-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: guest027, nhorman, rkhan
Target Milestone: alpha   
Target Release: 6.3   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-14 07:24:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
reproducer none

Description Hangbin Liu 2011-09-22 09:22:23 UTC
Created attachment 524362 [details]
reproducer

Description of problem:

When run SCTP LTP test cases as the regression test. Some tests were
failed. When run LTP SCPT test_1_to_1_accept_close.c test5, we got a
"Permission denied" on the last RHEL6.2 kernel even use root. But we can
got a "Invalid argument" on RHEL6.0 with normal user. 

----- LTP SCTP test_1_to_1_accept_close.c Test 5 ----------

/*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*/
error = accept(acpt_sk, (struct sockaddr *) &acpt_addr, &len);
if (error != -1 || errno != EINVAL)
        tst_brkm(TBROK, NULL, "accept on an established socket"
                     "error:%d, errno:%d", error, errno);

tst_resm(TPASS, "accept() on an established socket - EINVAL");

/*Closing the previously established association*/
close(acpt_sk);


Version-Release number of selected component (if applicable):

RHEL6.2

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 2 RHEL Program Management 2011-10-07 15:49:26 UTC
Since RHEL 6.2 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 3 Jia Ma 2011-10-09 03:21:24 UTC
That should be the error message for the "second accept", it's a invalid accept itself, right? I think the different messages(compare with 6.0) were related to some kernel changes, you know the perror output would not that accurate sometimes.

Comment 4 Jia Ma 2011-10-09 03:21:34 UTC
That should be the error message for the "second accept", it's a invalid accept itself, right? I think the different messages(compare with 6.0) were related to some kernel changes, you know the perror output would not that accurate sometimes.

Comment 5 Thomas Graf 2011-10-25 11:00:22 UTC
It must be selinux that returns -EPERM in this case, the SCTP accept code looks
correct:

SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err)
{
        [...]

	if (!sctp_sstate(sk, LISTENING)) {
		error = -EINVAL;
		goto out;
	}

Comment 8 Hangbin Liu 2011-12-14 07:24:42 UTC

*** This bug has been marked as a duplicate of bug 715518 ***