]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
uipc_usrreq: fix inode number assignment
authorMateusz Guzik <mjg@FreeBSD.org>
Wed, 21 Nov 2018 22:25:05 +0000 (22:25 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Wed, 21 Nov 2018 22:25:05 +0000 (22:25 +0000)
commitf218ac5087c7697321d3866d68c037cc88b0b005
tree7ba09bc00c0a6dec349474a84a69e156f3371b55
parenta627b4629d0c426ab9b769dfe1a352f8cef883c2
uipc_usrreq: fix inode number assignment

The code was incrementing a global variable in an unsafe manner.
Two different threads stating two different sockets could have resulted
in the same inode numbers assigned to both.

Creation is protected with a global lock, move the assigment there.
Since inode numbers are 64-bit now drop the check for overflows.

Sponsored by: The FreeBSD Foundation
sys/kern/uipc_usrreq.c