]> git.baikalelectronics.ru Git - kernel.git/commit
MODSIGN: Move the magic string to the end of a module and eliminate the search
authorDavid Howells <dhowells@redhat.com>
Sat, 20 Oct 2012 00:19:29 +0000 (01:19 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 20 Oct 2012 00:30:40 +0000 (17:30 -0700)
commit92224308f043f93c14b0283d838d42ec9680974f
treed92bf96b009bd0b0caec44c21348812b06805909
parentf94dbc93b3713f86925cc69cb9d2816c61d2fb51
MODSIGN: Move the magic string to the end of a module and eliminate the search

Emit the magic string that indicates a module has a signature after the
signature data instead of before it.  This allows module_sig_check() to
be made simpler and faster by the elimination of the search for the
magic string.  Instead we just need to do a single memcmp().

This works because at the end of the signature data there is the
fixed-length signature information block.  This block then falls
immediately prior to the magic number.

From the contents of the information block, it is trivial to calculate
the size of the signature data and thus the size of the actual module
data.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/module-internal.h
kernel/module.c
kernel/module_signing.c
scripts/sign-file