Skip to content

Commit

Permalink
s390/smp,sclp: fix size of sclp_cpu_info structure
Browse files Browse the repository at this point in the history
struct sclp_cpu_info contains entries only for 255 cpus, while the new
smp fallback sigp detection code will fill up to 256 entries.
Even though there is no machine available which has 256 cpus and where
in addition the fallback sigp cpu detection code will be used we better
fix this, to prevent out of bound accesses.

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 Dec 2, 2013
1 parent 9e3ea19 commit 9c09523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/s390/include/asm/sclp.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include <linux/types.h>
#include <asm/chpid.h>
#include <asm/cpu.h>

#define SCLP_CHP_INFO_MASK_SIZE 32

Expand Down Expand Up @@ -37,7 +38,7 @@ struct sclp_cpu_info {
unsigned int standby;
unsigned int combined;
int has_cpu_type;
struct sclp_cpu_entry cpu[255];
struct sclp_cpu_entry cpu[MAX_CPU_ADDRESS + 1];
};

int sclp_get_cpu_info(struct sclp_cpu_info *info);
Expand Down

0 comments on commit 9c09523

Please sign in to comment.