Bug 740503 - [SCTP] Permission denied on a established socket via root
Summary: [SCTP] Permission denied on a established socket via root
Keywords:
Status: CLOSED DUPLICATE of bug 715518
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel
Version: 6.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: alpha
: 6.3
Assignee: Thomas Graf
QA Contact: Network QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-22 09:22 UTC by Hangbin Liu
Modified: 2014-06-18 08:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-14 07:24:42 UTC


Attachments (Terms of Use)
reproducer (1.93 KB, text/plain)
2011-09-22 09:22 UTC, Hangbin Liu
no flags Details

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 Product and 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 ***


Note You need to log in before you can comment on or make changes to this bug.