aboutsummaryrefslogtreecommitdiffstats
path: root/security/tomoyo/gc.c
diff options
context:
space:
mode:
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>2010-05-16 21:09:15 -0400
committerJames Morris <jmorris@namei.org>2010-08-02 01:33:37 -0400
commita1f9bb6a375a8dbf7797ffbd6739c46b338a77f7 (patch)
tree44df8f05e6ad6bd7cf9ce398c99efbd7cff24c20 /security/tomoyo/gc.c
parentcb0abe6a5b58499bd4bc1403f4987af9ead0642c (diff)
TOMOYO: Split file access control functions by type of parameters.
Check numeric parameters for operations that deal them (e.g. chmod/chown/ioctl). Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/tomoyo/gc.c')
-rw-r--r--security/tomoyo/gc.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/security/tomoyo/gc.c b/security/tomoyo/gc.c
index 6a48197f6ce5..78100180d23d 100644
--- a/security/tomoyo/gc.c
+++ b/security/tomoyo/gc.c
@@ -106,6 +106,24 @@ static void tomoyo_del_acl(struct tomoyo_acl_info *acl)
106 tomoyo_put_name_union(&entry->name2); 106 tomoyo_put_name_union(&entry->name2);
107 } 107 }
108 break; 108 break;
109 case TOMOYO_TYPE_PATH_NUMBER_ACL:
110 {
111 struct tomoyo_path_number_acl *entry
112 = container_of(acl, typeof(*entry), head);
113 tomoyo_put_name_union(&entry->name);
114 tomoyo_put_number_union(&entry->number);
115 }
116 break;
117 case TOMOYO_TYPE_PATH_NUMBER3_ACL:
118 {
119 struct tomoyo_path_number3_acl *entry
120 = container_of(acl, typeof(*entry), head);
121 tomoyo_put_name_union(&entry->name);
122 tomoyo_put_number_union(&entry->mode);
123 tomoyo_put_number_union(&entry->major);
124 tomoyo_put_number_union(&entry->minor);
125 }
126 break;
109 default: 127 default:
110 printk(KERN_WARNING "Unknown type\n"); 128 printk(KERN_WARNING "Unknown type\n");
111 break; 129 break;
@@ -268,10 +286,7 @@ static void tomoyo_collect_entry(void)
268 case TOMOYO_TYPE_PATH_ACL: 286 case TOMOYO_TYPE_PATH_ACL:
269 if (container_of(acl, 287 if (container_of(acl,
270 struct tomoyo_path_acl, 288 struct tomoyo_path_acl,
271 head)->perm || 289 head)->perm)
272 container_of(acl,
273 struct tomoyo_path_acl,
274 head)->perm_high)
275 continue; 290 continue;
276 break; 291 break;
277 case TOMOYO_TYPE_PATH2_ACL: 292 case TOMOYO_TYPE_PATH2_ACL:
@@ -280,6 +295,18 @@ static void tomoyo_collect_entry(void)
280 head)->perm) 295 head)->perm)
281 continue; 296 continue;
282 break; 297 break;
298 case TOMOYO_TYPE_PATH_NUMBER_ACL:
299 if (container_of(acl,
300 struct tomoyo_path_number_acl,
301 head)->perm)
302 continue;
303 break;
304 case TOMOYO_TYPE_PATH_NUMBER3_ACL:
305 if (container_of(acl,
306 struct tomoyo_path_number3_acl,
307 head)->perm)
308 continue;
309 break;
283 default: 310 default:
284 continue; 311 continue;
285 } 312 }