From 595f43cf854a4a64de8c4ac23262cb5e222463f6 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 27 Oct 2009 19:24:46 -0700 Subject: [PATCH] --- yaml --- r: 169161 b: refs/heads/master c: 024e1a49411a1a7363e65db48edf1b09e9ee68ad h: refs/heads/master i: 169159: 7a839e38d772e76797ee3ea09ebcad582d58b48d v: v3 --- [refs] | 2 +- trunk/security/tomoyo/realpath.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 5d4cd0631094..7afd178db684 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d6ba452128178091dab7a04d54f7e66fdc32fb39 +refs/heads/master: 024e1a49411a1a7363e65db48edf1b09e9ee68ad diff --git a/trunk/security/tomoyo/realpath.c b/trunk/security/tomoyo/realpath.c index 5f2e33263371..917f564cdab1 100644 --- a/trunk/security/tomoyo/realpath.c +++ b/trunk/security/tomoyo/realpath.c @@ -13,6 +13,8 @@ #include #include #include +#include + #include "common.h" #include "realpath.h" @@ -263,7 +265,8 @@ static unsigned int tomoyo_quota_for_savename; * table. Frequency of appending strings is very low. So we don't need * large (e.g. 64k) hash size. 256 will be sufficient. */ -#define TOMOYO_MAX_HASH 256 +#define TOMOYO_HASH_BITS 8 +#define TOMOYO_MAX_HASH (1u<entry.hash && !strcmp(name, ptr->entry.name)) goto out; } @@ -365,7 +370,7 @@ const struct tomoyo_path_info *tomoyo_save_name(const char *name) tomoyo_fill_path_info(&ptr->entry); fmb->ptr += len; fmb->len -= len; - list_add_tail(&ptr->list, &tomoyo_name_list[hash % TOMOYO_MAX_HASH]); + list_add_tail(&ptr->list, head); if (fmb->len == 0) { list_del(&fmb->list); kfree(fmb);