lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Oops (request_key_auth_describe) while running cve-2016-7042 from LTP
Date
Hillf Danton <hdanton@sina.com> wrote:

> 1, callee has no pre defined duty to help caller in general; they should not
> try to do anything, however, to help their callers in principle due to
> limited info on their hands IMO.

Ah, no. It's entirely reasonable for an API to specify that one of its
methods will be called with one or more locks held - and that the method must
be aware of this and may make use of this.

> 3, no comment can be found in security/keys/request_key_auth.c about
> the rcu already documented.

There is API documentation in Documentation/security/keys/core.rst. If you
look at about line 1538 onwards:

* ``void (*describe)(const struct key *key, struct seq_file *p);``

This method is optional. It is called during /proc/keys reading to
summarise a key's description and payload in text form.

This method will be called with the RCU read lock held. rcu_dereference()
should be used to read the payload pointer if the payload is to be
accessed. key->datalen cannot be trusted to stay consistent with the
contents of the payload.

The description will not change, though the key's state may.

It is not safe to sleep in this method; the RCU read lock is held by the
caller.

David

\
 
 \ /
  Last update: 2019-08-30 17:12    [W:0.072 / U:4.912 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site