@@ -48,8 +48,8 @@ static int call_sbin_request_key(struct key *key,
4848 /* allocate a new session keyring */
4949 sprintf (desc , "_req.%u" , key -> serial );
5050
51- keyring = keyring_alloc (desc , current -> fsuid , current -> fsgid ,
52- current , 1 , NULL );
51+ keyring = keyring_alloc (desc , current -> fsuid , current -> fsgid , current ,
52+ KEY_ALLOC_QUOTA_OVERRUN , NULL );
5353 if (IS_ERR (keyring )) {
5454 ret = PTR_ERR (keyring );
5555 goto error_alloc ;
@@ -126,20 +126,21 @@ static int call_sbin_request_key(struct key *key,
126126 */
127127static struct key * __request_key_construction (struct key_type * type ,
128128 const char * description ,
129- const char * callout_info )
129+ const char * callout_info ,
130+ unsigned long flags )
130131{
131132 request_key_actor_t actor ;
132133 struct key_construction cons ;
133134 struct timespec now ;
134135 struct key * key , * authkey ;
135136 int ret , negated ;
136137
137- kenter ("%s,%s,%s" , type -> name , description , callout_info );
138+ kenter ("%s,%s,%s,%lx " , type -> name , description , callout_info , flags );
138139
139140 /* create a key and add it to the queue */
140141 key = key_alloc (type , description ,
141- current -> fsuid , current -> fsgid ,
142- current , KEY_POS_ALL , 0 );
142+ current -> fsuid , current -> fsgid , current , KEY_POS_ALL ,
143+ flags );
143144 if (IS_ERR (key ))
144145 goto alloc_failed ;
145146
@@ -258,15 +259,16 @@ static struct key *__request_key_construction(struct key_type *type,
258259static struct key * request_key_construction (struct key_type * type ,
259260 const char * description ,
260261 struct key_user * user ,
261- const char * callout_info )
262+ const char * callout_info ,
263+ unsigned long flags )
262264{
263265 struct key_construction * pcons ;
264266 struct key * key , * ckey ;
265267
266268 DECLARE_WAITQUEUE (myself , current );
267269
268- kenter ("%s,%s,{%d},%s" ,
269- type -> name , description , user -> uid , callout_info );
270+ kenter ("%s,%s,{%d},%s,%lx " ,
271+ type -> name , description , user -> uid , callout_info , flags );
270272
271273 /* see if there's such a key under construction already */
272274 down_write (& key_construction_sem );
@@ -282,7 +284,8 @@ static struct key *request_key_construction(struct key_type *type,
282284 }
283285
284286 /* see about getting userspace to construct the key */
285- key = __request_key_construction (type , description , callout_info );
287+ key = __request_key_construction (type , description , callout_info ,
288+ flags );
286289 error :
287290 kleave (" = %p" , key );
288291 return key ;
@@ -389,14 +392,15 @@ static void request_key_link(struct key *key, struct key *dest_keyring)
389392struct key * request_key_and_link (struct key_type * type ,
390393 const char * description ,
391394 const char * callout_info ,
392- struct key * dest_keyring )
395+ struct key * dest_keyring ,
396+ unsigned long flags )
393397{
394398 struct key_user * user ;
395399 struct key * key ;
396400 key_ref_t key_ref ;
397401
398- kenter ("%s,%s,%s,%p" ,
399- type -> name , description , callout_info , dest_keyring );
402+ kenter ("%s,%s,%s,%p,%lx " ,
403+ type -> name , description , callout_info , dest_keyring , flags );
400404
401405 /* search all the process keyrings for a key */
402406 key_ref = search_process_keyrings (type , description , type -> match ,
@@ -429,7 +433,8 @@ struct key *request_key_and_link(struct key_type *type,
429433 /* ask userspace (returns NULL if it waited on a key
430434 * being constructed) */
431435 key = request_key_construction (type , description ,
432- user , callout_info );
436+ user , callout_info ,
437+ flags );
433438 if (key )
434439 break ;
435440
@@ -485,7 +490,8 @@ struct key *request_key(struct key_type *type,
485490 const char * description ,
486491 const char * callout_info )
487492{
488- return request_key_and_link (type , description , callout_info , NULL );
493+ return request_key_and_link (type , description , callout_info , NULL ,
494+ KEY_ALLOC_IN_QUOTA );
489495
490496} /* end request_key() */
491497
0 commit comments