Skip to content

Commit

Permalink
[S390] cmm: fix crash on case conversion
Browse files Browse the repository at this point in the history
When the cmm module is compiled into the kernel it will crash when
writing to the R/O data section.
Reason is the lower to upper case conversion of the "sender" module
parameter which ignored the fact that the pointer is preinitialized.

Introduced with 41b4287 "cmm, smsgiucv_app: convert sender to
uppercase"

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Heiko Carstens authored and Martin Schwidefsky committed Oct 25, 2010
1 parent bf2106a commit a20852d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/s390/mm/cmm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
#include <asm/pgalloc.h>
#include <asm/diag.h>

static char *sender = "VMRMSVM";
#ifdef CONFIG_CMM_IUCV
static char *cmm_default_sender = "VMRMSVM";
#endif
static char *sender;
module_param(sender, charp, 0400);
MODULE_PARM_DESC(sender,
"Guest name that may send SMSG messages (default VMRMSVM)");
Expand Down Expand Up @@ -440,6 +443,8 @@ static int __init cmm_init(void)
int len = strlen(sender);
while (len--)
sender[len] = toupper(sender[len]);
} else {
sender = cmm_default_sender;
}

rc = smsg_register_callback(SMSG_PREFIX, cmm_smsg_target);
Expand Down

0 comments on commit a20852d

Please sign in to comment.