linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sys_uselib in exec.c
@ 2004-03-24  2:05 Shaya Potter
  2004-03-24  5:29 ` Maneesh Soni
  0 siblings, 1 reply; 2+ messages in thread
From: Shaya Potter @ 2004-03-24  2:05 UTC (permalink / raw)
  To: linux-fsdevel

the code there is (2.6.1)

125         error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN,
&nd);
126         if (error)
127                 goto out;
128 
129         error = -EINVAL;
130         if (!S_ISREG(nd.dentry->d_inode->i_mode))
131                 goto exit;
132 
133         error = permission(nd.dentry->d_inode, MAY_READ | MAY_EXEC,
&nd);
134         if (error)
135                 goto exit;
136 
137         file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
138         error = PTR_ERR(file);
139         if (IS_ERR(file))
140                 goto out;

where exit does a path_release(&nd) and return's error while out just
returns error.

if dentry_open fails, we don't call path_release(&nd).  Is this correct?

thanks,

shaya


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sys_uselib in exec.c
  2004-03-24  2:05 sys_uselib in exec.c Shaya Potter
@ 2004-03-24  5:29 ` Maneesh Soni
  0 siblings, 0 replies; 2+ messages in thread
From: Maneesh Soni @ 2004-03-24  5:29 UTC (permalink / raw)
  To: Shaya Potter; +Cc: linux-fsdevel

On Wed, Mar 24, 2004 at 02:05:55AM +0000, Shaya Potter wrote:
> the code there is (2.6.1)
> 
> 125         error = __user_walk(library, LOOKUP_FOLLOW|LOOKUP_OPEN,
> &nd);
> 126         if (error)
> 127                 goto out;
> 128 
> 129         error = -EINVAL;
> 130         if (!S_ISREG(nd.dentry->d_inode->i_mode))
> 131                 goto exit;
> 132 
> 133         error = permission(nd.dentry->d_inode, MAY_READ | MAY_EXEC,
> &nd);
> 134         if (error)
> 135                 goto exit;
> 136 
> 137         file = dentry_open(nd.dentry, nd.mnt, O_RDONLY);
> 138         error = PTR_ERR(file);
> 139         if (IS_ERR(file))
> 140                 goto out;
> 
> where exit does a path_release(&nd) and return's error while out just
> returns error.
> 
> if dentry_open fails, we don't call path_release(&nd).  Is this correct?

dentry_open, cleans up dentry and mnt if it has to return error..

Maneesh


-- 
Maneesh Soni
Linux Technology Center, 
IBM Software Lab, Bangalore, India
email: maneesh@in.ibm.com
Phone: 91-80-25044999 Fax: 91-80-25268553
T/L : 9243696

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-24  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24  2:05 sys_uselib in exec.c Shaya Potter
2004-03-24  5:29 ` Maneesh Soni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).