@@ -2573,13 +2573,13 @@ static int filename_parentat(int dfd, struct filename *name,
2573
2573
}
2574
2574
2575
2575
/* does lookup, returns the object with parent locked */
2576
- static struct dentry * __kern_path_locked (struct filename * name , struct path * path )
2576
+ static struct dentry * __kern_path_locked (int dfd , struct filename * name , struct path * path )
2577
2577
{
2578
2578
struct dentry * d ;
2579
2579
struct qstr last ;
2580
2580
int type , error ;
2581
2581
2582
- error = filename_parentat (AT_FDCWD , name , 0 , path , & last , & type );
2582
+ error = filename_parentat (dfd , name , 0 , path , & last , & type );
2583
2583
if (error )
2584
2584
return ERR_PTR (error );
2585
2585
if (unlikely (type != LAST_NORM )) {
@@ -2598,12 +2598,22 @@ static struct dentry *__kern_path_locked(struct filename *name, struct path *pat
2598
2598
struct dentry * kern_path_locked (const char * name , struct path * path )
2599
2599
{
2600
2600
struct filename * filename = getname_kernel (name );
2601
- struct dentry * res = __kern_path_locked (filename , path );
2601
+ struct dentry * res = __kern_path_locked (AT_FDCWD , filename , path );
2602
2602
2603
2603
putname (filename );
2604
2604
return res ;
2605
2605
}
2606
2606
2607
+ struct dentry * user_path_locked_at (int dfd , const char __user * name , struct path * path )
2608
+ {
2609
+ struct filename * filename = getname (name );
2610
+ struct dentry * res = __kern_path_locked (dfd , filename , path );
2611
+
2612
+ putname (filename );
2613
+ return res ;
2614
+ }
2615
+ EXPORT_SYMBOL (user_path_locked_at );
2616
+
2607
2617
int kern_path (const char * name , unsigned int flags , struct path * path )
2608
2618
{
2609
2619
struct filename * filename = getname_kernel (name );
0 commit comments