From 15439d74f621ff8252b53136d259781148e6e768 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Sun, 1 May 2005 08:58:58 -0700 Subject: [PATCH] s390: cmm guest sender id An arbitrary guest must not be allowed to trigger cmm actions. Only one specific guest namely the one that serves as the resource monitor may send cmm messages. Add a parameter that allows to specify the guest that may send messages. z/VMs resource manager has the name 'VMRMSVM' which is the default. Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/s390/mm/cmm.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'arch/s390') diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c index d30cdb4248a..f5a5bc09b8f 100644 --- a/arch/s390/mm/cmm.c +++ b/arch/s390/mm/cmm.c @@ -20,6 +20,11 @@ #include #include +static char *sender = "VMRMSVM"; +module_param(sender, charp, 0); +MODULE_PARM_DESC(sender, + "Guest name that may send SMSG messages (default VMRMSVM)"); + #include "../../../drivers/s390/net/smsgiucv.h" #define CMM_NR_PAGES ((PAGE_SIZE / sizeof(unsigned long)) - 2) @@ -367,10 +372,12 @@ static struct ctl_table cmm_dir_table[] = { #ifdef CONFIG_CMM_IUCV #define SMSG_PREFIX "CMM" static void -cmm_smsg_target(char *msg) +cmm_smsg_target(char *from, char *msg) { long pages, seconds; + if (strlen(sender) > 0 && strcmp(from, sender) != 0) + return; if (!cmm_skip_blanks(msg + strlen(SMSG_PREFIX), &msg)) return; if (strncmp(msg, "SHRINK", 6) == 0) { -- cgit v1.2.2