mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [CHECKER] race in 2.5.62/fs/exec.c?
@ 2003-03-22 19:40 Dawson Engler
  2003-03-22 21:45 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Dawson Engler @ 2003-03-22 19:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dawson Engler

I'm not sure if I'm missing something --- is the following a race?

           2.5.62/fs/exec.c:1013:search_binary_handler:
                        read_unlock(&binfmt_lock);
                        retval = fn(bprm, regs);
                        if (retval >= 0) {
                                put_binfmt(fmt);

binfmt_lock is released and then put_binfmt is called.  put_binfmt
seems to need locking:

    fs/exec.c:1022:search_binary_handle

                        read_lock(&binfmt_lock);
                        put_binfmt(fmt);
                        if (retval != -ENOEXEC)
                                break;
                        if (!bprm->file) {
                                read_unlock(&binfmt_lock);
                                return retval;
                        }


   2.5.62/fs/exec.c:151:sys_uselib:

                     error = fmt->load_shlib(file);
                        read_lock(&binfmt_lock);
                        put_binfmt(fmt);
                        if (error != -ENOEXEC)
                                break;
                }

Are these other locks redundant?  Or does put_binfmt need protection?

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

end of thread, other threads:[~2003-03-22 21:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22 19:40 [CHECKER] race in 2.5.62/fs/exec.c? Dawson Engler
2003-03-22 21:45 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®