536 |
mode &= ~current->fs->umask; |
mode &= ~current->fs->umask; |
537 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
538 |
+ error = ccs_check_mknod_permission(dir->d_inode, path.dentry, |
+ error = ccs_check_mknod_permission(dir->d_inode, path.dentry, |
539 |
+ nd->path.mnt, mode, 0); |
+ nd->mnt, mode, 0); |
540 |
+ if (!error) |
+ if (!error) |
541 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
542 |
error = vfs_create(dir->d_inode, path.dentry, mode, nd); |
error = vfs_create(dir->d_inode, path.dentry, mode, nd); |
547 |
mode &= ~current->fs->umask; |
mode &= ~current->fs->umask; |
548 |
if (!IS_ERR(dentry)) { |
if (!IS_ERR(dentry)) { |
549 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
550 |
+ error = ccs_check_mknod_permission(nd.path.dentry->d_inode, |
+ error = ccs_check_mknod_permission(nd.dentry->d_inode, dentry, |
551 |
+ dentry, nd.path.mnt, mode, |
+ nd.mnt, mode, |
552 |
+ new_decode_dev(dev)); |
+ new_decode_dev(dev)); |
553 |
+ if (!error) |
+ if (!error) |
554 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
1252 |
head = &hashinfo->bhash[inet_bhashfn(rover, hashinfo->bhash_size)]; |
head = &hashinfo->bhash[inet_bhashfn(rover, hashinfo->bhash_size)]; |
1253 |
spin_lock(&head->lock); |
spin_lock(&head->lock); |
1254 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1255 |
+ if (ccs_may_autobind(rover)) |
+ if (ccs_lport_reserved(rover)) |
1256 |
+ goto next; |
+ goto next; |
1257 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1258 |
inet_bind_bucket_for_each(tb, node, &head->chain) |
inet_bind_bucket_for_each(tb, node, &head->chain) |
1275 |
for (i = 1; i <= range; i++) { |
for (i = 1; i <= range; i++) { |
1276 |
port = low + (i + offset) % range; |
port = low + (i + offset) % range; |
1277 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1278 |
+ if (ccs_may_autobind(port)) |
+ if (ccs_lport_reserved(port)) |
1279 |
+ continue; |
+ continue; |
1280 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1281 |
head = &tcp_hashinfo.bhash[inet_bhashfn(port, tcp_hashinfo.bhash_size)]; |
head = &tcp_hashinfo.bhash[inet_bhashfn(port, tcp_hashinfo.bhash_size)]; |
1298 |
((result - sysctl_local_port_range[0]) & |
((result - sysctl_local_port_range[0]) & |
1299 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1300 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1301 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1302 |
+ continue; |
+ continue; |
1303 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1304 |
goto gotit; |
goto gotit; |
1309 |
+ ((result - sysctl_local_port_range[0]) & |
+ ((result - sysctl_local_port_range[0]) & |
1310 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1311 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1312 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1313 |
+ continue; |
+ continue; |
1314 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1315 |
if (!udp_lport_inuse(result)) |
if (!udp_lport_inuse(result)) |
1332 |
head = &tcp_hashinfo.bhash[inet_bhashfn(rover, tcp_hashinfo.bhash_size)]; |
head = &tcp_hashinfo.bhash[inet_bhashfn(rover, tcp_hashinfo.bhash_size)]; |
1333 |
spin_lock(&head->lock); |
spin_lock(&head->lock); |
1334 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1335 |
+ if (ccs_may_autobind(rover)) |
+ if (ccs_lport_reserved(rover)) |
1336 |
+ goto next; |
+ goto next; |
1337 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1338 |
inet_bind_bucket_for_each(tb, node, &head->chain) |
inet_bind_bucket_for_each(tb, node, &head->chain) |
1343 |
for (i = 1; i <= range; i++) { |
for (i = 1; i <= range; i++) { |
1344 |
port = low + (i + offset) % range; |
port = low + (i + offset) % range; |
1345 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1346 |
+ if (ccs_may_autobind(port)) |
+ if (ccs_lport_reserved(port)) |
1347 |
+ continue; |
+ continue; |
1348 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1349 |
head = &tcp_hashinfo.bhash[inet_bhashfn(port, tcp_hashinfo.bhash_size)]; |
head = &tcp_hashinfo.bhash[inet_bhashfn(port, tcp_hashinfo.bhash_size)]; |
1366 |
((result - sysctl_local_port_range[0]) & |
((result - sysctl_local_port_range[0]) & |
1367 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1368 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1369 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1370 |
+ continue; |
+ continue; |
1371 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1372 |
goto gotit; |
goto gotit; |
1377 |
+ ((result - sysctl_local_port_range[0]) & |
+ ((result - sysctl_local_port_range[0]) & |
1378 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1379 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1380 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1381 |
+ continue; |
+ continue; |
1382 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1383 |
if (!udp_lport_inuse(result)) |
if (!udp_lport_inuse(result)) |