From: hooanon05@yahoo.co.jp
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Q. Switch open_exec() and sys_uselib() to do_open_filp()
Date: Mon, 11 May 2009 11:46:15 +0900 [thread overview]
Message-ID: <31197.1242009975@jrobl> (raw)
In-Reply-To: <20090511012828.GH8633@ZenIV.linux.org.uk>
Al Viro:
> On Mon, May 11, 2009 at 09:55:17AM +0900, hooanon05@yahoo.co.jp wrote:
> >
> > By the commit 6e8341a11eb21826b7192d0bb88cb5b44900a9af
> > "Switch open_exec() and sys_uselib() to do_open_filp()",
> > FMODE_EXEC flag is passed to struct file. I have no objection nor
> > question about that.
> >
> > But it is set to file->f_flags instead of f_mode.
> > Is this intended behaviour?
>
> It is previously existing behaviour. Check what path_lookup_open() does
> and how had it used to be called.
My poor English may make me misunderstood.
Please let me make sure.
Do you mean FMODE_EXEC was passed to struct file before this commit?
Previous open_exec() used to call
file = nameidata_to_filp(&nd, O_RDONLY|O_LARGEFILE)
and it calls
filp = __dentry_open(nd->path.dentry, nd->path.mnt, flags, filp,
NULL);
__dentry_open()
{
f->f_flags = flags;
f->f_mode = ((flags+1) & O_ACCMODE) | FMODE_LSEEK |
FMODE_PREAD | FMODE_PWRITE;
;;;
}
So FMODE_EXEC was not set to f_flags/f_mode, O_RDONLY|O_LARGEFILE only.
After the commit, open_exec() calls
file = do_filp_open(AT_FDCWD, name,
O_LARGEFILE | O_RDONLY | FMODE_EXEC, 0,
MAY_EXEC | MAY_OPEN);
and it calls
filp = nameidata_to_filp(&nd, open_flag);
So f_flags becomes containing FMODE_EXEC, O_LARGEFILE | O_RDONLY | FMODE_EXEC.
This change of the behaviour is my question since a strict type fmode_t
was defined in 2.6.28 or 29 and FMODE_EXEC looks being set to f_mode.
If setting FMODE_xxx to f_flags is intended, it is OK.
J. R. Okajima
next prev parent reply other threads:[~2009-05-11 2:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-11 0:55 Q. Switch open_exec() and sys_uselib() to do_open_filp() hooanon05
2009-05-11 1:28 ` Al Viro
2009-05-11 2:46 ` hooanon05 [this message]
2009-05-11 4:00 ` Al Viro
2009-05-11 5:20 ` hooanon05
2009-05-11 6:52 ` Al Viro
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31197.1242009975@jrobl \
--to=hooanon05@yahoo.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.