so_peerlabel can only be used when the socket is not listening.
Details
Details
kldload mac_test nc -l 1234
and then terminate nc using CTRL-C.
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Hum, this bug is quite old. :(
sys/kern/uipc_socket.c | ||
---|---|---|
4178 | The right place to check this is in mac_getsockopt_peerlabel(). Without the socket lock (which is acquired in that function), it is possible for listen() and getsockopt(SO_PEERLABEL) to race with each other. |
sys/kern/uipc_socket.c | ||
---|---|---|
4178 | I totally agree. Fixed. But doesn't this comment apply also to the others usages of SOLISTENING() in sogetopt()? |
Comment Actions
I think this is ok. The bug suggests that we should optionally run the regression test suite with mac_test loaded. I tried it locally and easily reproduced the original panic. Perhaps @olivier would want to try this in his test environment?