[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <31231.1272977336@redhat.com>
Date: Tue, 04 May 2010 13:48:56 +0100
From: David Howells <dhowells@...hat.com>
To: "Serge E. Hallyn" <serue@...ibm.com>
Cc: dhowells@...hat.com, torvalds@...l.org, akpm@...ux-foundation.org,
keyrings@...ux-nfs.org, linux-security-module@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/7] KEYS: Fix an RCU warning in the reading of user keys
Serge E. Hallyn <serue@...ibm.com> wrote:
> heck it also serves to document it a bit, as looking at the fn
> itself it's not clear that it is called under key->sem.
Give or take the banner comment on user_read() where it states this explicitly:
/*
* read the key data
* - the key's semaphore is read-locked
*/
long user_read(const struct key *key, char __user *buffer, size_t buflen)
and Documentation/keys.txt where it also states this explicitly:
(*) long (*read)(const struct key *key, char __user *buffer, size_t buflen);
...
This method will be called with the key's semaphore read-locked. This will
prevent the key's payload changing. It is not necessary to use RCU locking
when accessing the key's payload. It is safe to sleep in this method, such
as might happen when the userspace buffer is accessed.
:-)
David
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists