537 |
mode &= ~current->fs->umask; |
mode &= ~current->fs->umask; |
538 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
539 |
+ error = ccs_check_mknod_permission(dir->d_inode, path.dentry, |
+ error = ccs_check_mknod_permission(dir->d_inode, path.dentry, |
540 |
+ nd->path.mnt, mode, 0); |
+ nd->mnt, mode, 0); |
541 |
+ if (!error) |
+ if (!error) |
542 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
543 |
error = vfs_create(dir->d_inode, path.dentry, mode, nd); |
error = vfs_create(dir->d_inode, path.dentry, mode, nd); |
548 |
mode &= ~current->fs->umask; |
mode &= ~current->fs->umask; |
549 |
if (!IS_ERR(dentry)) { |
if (!IS_ERR(dentry)) { |
550 |
+ /***** TOMOYO Linux start. *****/ |
+ /***** TOMOYO Linux start. *****/ |
551 |
+ error = ccs_check_mknod_permission(nd.path.dentry->d_inode, |
+ error = ccs_check_mknod_permission(nd.dentry->d_inode, dentry, |
552 |
+ dentry, nd.path.mnt, mode, |
+ nd.mnt, mode, |
553 |
+ new_decode_dev(dev)); |
+ new_decode_dev(dev)); |
554 |
+ if (!error) |
+ if (!error) |
555 |
+ /***** TOMOYO Linux end. *****/ |
+ /***** TOMOYO Linux end. *****/ |
1251 |
head = &hashinfo->bhash[inet_bhashfn(rover, hashinfo->bhash_size)]; |
head = &hashinfo->bhash[inet_bhashfn(rover, hashinfo->bhash_size)]; |
1252 |
spin_lock(&head->lock); |
spin_lock(&head->lock); |
1253 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1254 |
+ if (ccs_may_autobind(rover)) |
+ if (ccs_lport_reserved(rover)) |
1255 |
+ goto next; |
+ goto next; |
1256 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1257 |
inet_bind_bucket_for_each(tb, node, &head->chain) |
inet_bind_bucket_for_each(tb, node, &head->chain) |
1274 |
for (i = 1; i <= range; i++) { |
for (i = 1; i <= range; i++) { |
1275 |
port = low + (i + offset) % range; |
port = low + (i + offset) % range; |
1276 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1277 |
+ if (ccs_may_autobind(port)) |
+ if (ccs_lport_reserved(port)) |
1278 |
+ continue; |
+ continue; |
1279 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1280 |
head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; |
head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; |
1297 |
((result - sysctl_local_port_range[0]) & |
((result - sysctl_local_port_range[0]) & |
1298 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1299 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1300 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1301 |
+ continue; |
+ continue; |
1302 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1303 |
goto gotit; |
goto gotit; |
1308 |
+ ((result - sysctl_local_port_range[0]) & |
+ ((result - sysctl_local_port_range[0]) & |
1309 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1310 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1311 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1312 |
+ continue; |
+ continue; |
1313 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1314 |
if (!udp_lport_inuse(result)) |
if (!udp_lport_inuse(result)) |
1340 |
for (i = 1; i <= range; i++) { |
for (i = 1; i <= range; i++) { |
1341 |
port = low + (i + offset) % range; |
port = low + (i + offset) % range; |
1342 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1343 |
+ if (ccs_may_autobind(port)) |
+ if (ccs_lport_reserved(port)) |
1344 |
+ continue; |
+ continue; |
1345 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1346 |
head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; |
head = &hinfo->bhash[inet_bhashfn(port, hinfo->bhash_size)]; |
1363 |
((result - sysctl_local_port_range[0]) & |
((result - sysctl_local_port_range[0]) & |
1364 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1365 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1366 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1367 |
+ continue; |
+ continue; |
1368 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1369 |
goto gotit; |
goto gotit; |
1374 |
+ ((result - sysctl_local_port_range[0]) & |
+ ((result - sysctl_local_port_range[0]) & |
1375 |
(UDP_HTABLE_SIZE - 1)); |
(UDP_HTABLE_SIZE - 1)); |
1376 |
+ /***** SAKURA Linux start. *****/ |
+ /***** SAKURA Linux start. *****/ |
1377 |
+ if (ccs_may_autobind(result)) |
+ if (ccs_lport_reserved(result)) |
1378 |
+ continue; |
+ continue; |
1379 |
+ /***** SAKURA Linux end. *****/ |
+ /***** SAKURA Linux end. *****/ |
1380 |
if (!udp_lport_inuse(result)) |
if (!udp_lport_inuse(result)) |