diff options
Diffstat (limited to 'security/selinux/ss/conditional.c')
| -rw-r--r-- | security/selinux/ss/conditional.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c index daf288007460..d2737edba541 100644 --- a/security/selinux/ss/conditional.c +++ b/security/selinux/ss/conditional.c | |||
| @@ -220,10 +220,9 @@ int cond_read_bool(struct policydb *p, struct hashtab *h, void *fp) | |||
| 220 | u32 len; | 220 | u32 len; |
| 221 | int rc; | 221 | int rc; |
| 222 | 222 | ||
| 223 | booldatum = kmalloc(sizeof(struct cond_bool_datum), GFP_KERNEL); | 223 | booldatum = kzalloc(sizeof(struct cond_bool_datum), GFP_KERNEL); |
| 224 | if (!booldatum) | 224 | if (!booldatum) |
| 225 | return -1; | 225 | return -1; |
| 226 | memset(booldatum, 0, sizeof(struct cond_bool_datum)); | ||
| 227 | 226 | ||
| 228 | rc = next_entry(buf, fp, sizeof buf); | 227 | rc = next_entry(buf, fp, sizeof buf); |
| 229 | if (rc < 0) | 228 | if (rc < 0) |
| @@ -321,10 +320,9 @@ static int cond_insertf(struct avtab *a, struct avtab_key *k, struct avtab_datum | |||
| 321 | goto err; | 320 | goto err; |
| 322 | } | 321 | } |
| 323 | 322 | ||
| 324 | list = kmalloc(sizeof(struct cond_av_list), GFP_KERNEL); | 323 | list = kzalloc(sizeof(struct cond_av_list), GFP_KERNEL); |
| 325 | if (!list) | 324 | if (!list) |
| 326 | goto err; | 325 | goto err; |
| 327 | memset(list, 0, sizeof(*list)); | ||
| 328 | 326 | ||
| 329 | list->node = node_ptr; | 327 | list->node = node_ptr; |
| 330 | if (!data->head) | 328 | if (!data->head) |
| @@ -414,11 +412,10 @@ static int cond_read_node(struct policydb *p, struct cond_node *node, void *fp) | |||
| 414 | if (rc < 0) | 412 | if (rc < 0) |
| 415 | goto err; | 413 | goto err; |
| 416 | 414 | ||
| 417 | expr = kmalloc(sizeof(struct cond_expr), GFP_KERNEL); | 415 | expr = kzalloc(sizeof(struct cond_expr), GFP_KERNEL); |
| 418 | if (!expr) { | 416 | if (!expr) { |
| 419 | goto err; | 417 | goto err; |
| 420 | } | 418 | } |
| 421 | memset(expr, 0, sizeof(struct cond_expr)); | ||
| 422 | 419 | ||
| 423 | expr->expr_type = le32_to_cpu(buf[0]); | 420 | expr->expr_type = le32_to_cpu(buf[0]); |
| 424 | expr->bool = le32_to_cpu(buf[1]); | 421 | expr->bool = le32_to_cpu(buf[1]); |
| @@ -460,10 +457,9 @@ int cond_read_list(struct policydb *p, void *fp) | |||
| 460 | len = le32_to_cpu(buf[0]); | 457 | len = le32_to_cpu(buf[0]); |
| 461 | 458 | ||
| 462 | for (i = 0; i < len; i++) { | 459 | for (i = 0; i < len; i++) { |
| 463 | node = kmalloc(sizeof(struct cond_node), GFP_KERNEL); | 460 | node = kzalloc(sizeof(struct cond_node), GFP_KERNEL); |
| 464 | if (!node) | 461 | if (!node) |
| 465 | goto err; | 462 | goto err; |
| 466 | memset(node, 0, sizeof(struct cond_node)); | ||
| 467 | 463 | ||
| 468 | if (cond_read_node(p, node, fp) != 0) | 464 | if (cond_read_node(p, node, fp) != 0) |
| 469 | goto err; | 465 | goto err; |
