Messages in this thread | ![/](/images/icornerl.gif) | | Date | Sat, 24 Apr 2010 09:32:54 +0900 (JST) | Subject | Re: [PATCH 1/1][BUG][TAKE2] KEYRINGS: find_keyring_by_name() can gain the freed keyring | From | 岡嶋 寿行 <> |
| |
> Toshiyuki Okajima <toshi.okajima@jp.fujitsu.com> wrote: > >> > Better still, atomic_inc_not_zero(). How about the attached patch? >> Your fix looks good to me. But, if usage count of the keyring is 0, >> I think it better to return -ENOKEY immediately. >
> The problem with that is that someone else may have created a keyring with > the > same name that you can't then reach until the dead keyring is deleted.
OK. I understand. --- Once find_keyring_by_name() returns -ENOKEY, the new user creates a new key. So, both the deleting key and the new key may exist. Therefore at next find_keyring_by_name() call, we should find the new key and ignore the deleting key. ---
Toshiyuki Okajima
| ![\](/images/icornerr.gif) |