public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Rusty Russell <rusty@rustcorp•com.au>
Cc: linux-next@vger•kernel.org, linux-kernel@vger•kernel.org,
	David Howells <dhowells@redhat•com>,
	Linus <torvalds@linux-foundation•org>,
	Kees Cook <keescook@chromium•org>,
	Andrew Morton <akpm@linux-foundation•org>
Subject: linux-next: manual merge of the modules tree with the  tree
Date: Mon, 22 Oct 2012 12:35:53 +1100	[thread overview]
Message-ID: <20121022123553.240d9ddf05cd5e2c8fee0ab3@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 2015 bytes --]

Hi Rusty,

Today's linux-next merge of the modules tree got a conflict in
kernel/module.c between commit caabe240574a ("MODSIGN: Move the magic
string to the end of a module and eliminate the search") from Linus' tree
and commit 0250abdeec54 ("module: add syscall to load module from fd")
from the modules tree.

I fixed it up (I think - see below) and can carry the fix as necessary
(no action is required).

I do wonder why the above change in Linus' tree seems to have bypassed
the modules maintainer.

-- 
Cheers,
Stephen Rothwell                    sfr@canb•auug.org.au

diff --cc kernel/module.c
index 6085f5e,261bf82..0000000
--- a/kernel/module.c
+++ b/kernel/module.c
@@@ -2420,18 -2422,27 +2422,18 @@@ static inline void kmemleak_load_module
  #endif
  
  #ifdef CONFIG_MODULE_SIG
- static int module_sig_check(struct load_info *info,
- 			    const void *mod, unsigned long *_len)
+ static int module_sig_check(struct load_info *info)
  {
  	int err = -ENOKEY;
- 	unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
- 	unsigned long len = *_len;
+ 	const unsigned long markerlen = sizeof(MODULE_SIG_STRING) - 1;
+ 	const void *mod = info->hdr;
 -	const void *p = mod, *end = mod + info->len;
++	unsigned long len = info->len;
  
 -	/* Poor man's memmem. */
 -	while ((p = memchr(p, MODULE_SIG_STRING[0], end - p))) {
 -		if (p + markerlen > end)
 -			break;
 -
 -		if (memcmp(p, MODULE_SIG_STRING, markerlen) == 0) {
 -			const void *sig = p + markerlen;
 -			/* Truncate module up to signature. */
 -			info->len = p - mod;
 -			err = mod_verify_sig(mod, info->len,
 -					     sig, end - sig);
 -			break;
 -		}
 -		p++;
 +	if (len > markerlen &&
 +	    memcmp(mod + len - markerlen, MODULE_SIG_STRING, markerlen) == 0) {
 +		/* We truncate the module to discard the signature */
- 		*_len -= markerlen;
- 		err = mod_verify_sig(mod, _len);
++		info->len -= markerlen;
++		err = mod_verify_sig(mod, &info->len);
  	}
  
  	if (!err) {

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

             reply	other threads:[~2012-10-22  1:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22  1:35 Stephen Rothwell [this message]
2012-10-22  2:09 ` linux-next: manual merge of the modules tree with the tree Kees Cook
2012-10-24  0:21 ` Rusty Russell

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=20121022123553.240d9ddf05cd5e2c8fee0ab3@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=dhowells@redhat$(echo .)com \
    --cc=keescook@chromium$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=rusty@rustcorp$(echo .)com.au \
    --cc=torvalds@linux-foundation$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox