Date: Thu, 14 Jan 2021 15:07:42 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 252673] Read on a SEQPACKET AF_UNIX socket returns the wrong error when disallowed by Capsicum Message-ID: <bug-252673-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D252673 Bug ID: 252673 Summary: Read on a SEQPACKET AF_UNIX socket returns the wrong error when disallowed by Capsicum Product: Base System Version: 12.2-STABLE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: theraven@FreeBSD.org A socket is created with: ``` socketpair(AF_UNIX, SOCK_SEQPACKET, 0, socks); ``` And then restricted with: ``` cap_rights_t rights; cap_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE)); ``` When passed to the `read` system call, it fails (as it should) but returns `ENOENT`. This is not a documented error value for `read`. I believe the correct return value is `ENOTCAPABLE` (which is also not a documented return value for read, but would have immediately told me what the problem was). I have not validated whether different kinds of socket have the same behavi= our. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-252673-227>