[CHECKER] race in 2.5.62/fs/exec.c?

From: Dawson Engler (engler@csl.stanford.edu)
Date: Sat Mar 22 2003 - 14:40:48 EST


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?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:42 EST