linux/scripts/mod
Cedric Hombourger 99e3a1eb3c kbuild: fix Module.markers permission error under cygwin
While building the kernel, we end-up calling modpost with -K and -M
options for the same file (Modules.markers).  This is resulting in
modpost's main function calling read_markers() and then write_markers() on
the same file.

We then have read_markers() mmap'ing the file, and writer_markers()
opening that same file for writing.

The issue is that read_markers() exits without munmap'ing the file and is
as a matter holding a reference on Modules.markers.  When write_markers()
is opening that very same file for writing, we still have a reference on
it and cygwin (Windows?) is then making fopen() fail with EPERM.

Calling release_file() before exiting read_markers() clears that reference
(and memory leak) and fopen() then succeeds.

Tested on both cygwin (1.3.22) and Linux.  Also ran modpost within
valgrind on Linux to make sure that the munmap'ed file was not accessed
after read_markers()

Signed-off-by: Cedric Hombourger <chombourger@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2009-05-01 10:54:03 +02:00
..
.gitignore Add some basic .gitignore files 2005-10-18 08:26:15 -07:00
empty.c Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
file2alias.c platform: introduce module id table for platform devices 2009-03-24 16:38:24 -07:00
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
mk_elfconfig.c remove the v850 port 2008-07-24 10:47:24 -07:00
modpost.c kbuild: fix Module.markers permission error under cygwin 2009-05-01 10:54:03 +02:00
modpost.h kbuild: soften modpost checks when doing cross builds 2008-03-23 21:38:54 +01:00
sumversion.c kbuild: prevent modpost from looking for a .cmd file for a static library linked into a module 2008-10-29 22:02:10 +01:00