Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1735083
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] KEYS: fix race between updating and finding negative key |
| Date | 2017-09-19 18:30 +0200 |
| Message-ID | <urtzj-7ID-1@gated-at.bofh.it> (permalink) |
| References | <urbj4-32d-1@gated-at.bofh.it> |
| Organization | Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 |
Eric Biggers <ebiggers3@gmail.com> wrote: > Fix the bug by moving ->reject_error out of the union with ->payload, > then using nonzero ->reject_error to mean that the key is negative. > > This eliminates the need for KEY_FLAG_NEGATIVE, which we remove as well > so that we don't have to handle memory ordering between > KEY_FLAG_NEGATIVE and ->reject_error. We *do* still need to handle > memory ordering between KEY_FLAG_INSTANTIATED and ->reject_error, but > that was needed before (and for KEY_FLAG_NEGATIVE as well --- though it > wasn't done correctly, which was another bug). Hmmm... My only objection is that it extends struct key still further, but you do have a point. If we're going to do this, can we eliminate KEY_FLAG_INSTANTIATED also and make ->reject_error into ->status? 0 -> uninstantiated 1 -> instantiated <0 -> negatively instantiated/rejected Also, can we make it a short int please? Also, can setting this field be done with a release barrier rather than a write barrier? David
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] KEYS: fix race between updating and finding negative key Eric Biggers <ebiggers3@gmail.com> - 2017-09-18 23:00 +0200 Re: [PATCH] KEYS: fix race between updating and finding negative key David Howells <dhowells@redhat.com> - 2017-09-19 18:30 +0200
csiph-web