[tor-bugs] #16215 [Tor]: missing return value check in sb_socket()

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed May 27 17:31:58 UTC 2015


#16215: missing return value check in sb_socket()
--------------------+------------------------------
 Reporter:  weasel  |          Owner:
     Type:  defect  |         Status:  new
 Priority:  normal  |      Milestone:
Component:  Tor     |        Version:  Tor: 0.2.6.7
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
--------------------+------------------------------
 All the other seccomp_rule_add calls check their return values.  One
 doesn't.

 It probably should conform.

 {{{
 --- a/src/common/sandbox.c
 +++ b/src/common/sandbox.c
 @@ -547,6 +547,8 @@ sb_socket(scmp_filter_ctx ctx, sandbox_cfg_t *filter)
        SCMP_CMP(0, SCMP_CMP_EQ, PF_UNIX),
        SCMP_CMP_MASKED(1, SOCK_CLOEXEC|SOCK_NONBLOCK, SOCK_STREAM),
        SCMP_CMP(2, SCMP_CMP_EQ, 0));
 +  if (rc)
 +    return rc;

    rc = seccomp_rule_add_3(ctx, SCMP_ACT_ALLOW, SCMP_SYS(socket),
        SCMP_CMP(0, SCMP_CMP_EQ, PF_NETLINK),
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/16215>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list