xemu/target/i386
Eduardo Habkost 807e9869b8 i386: Change X86CPUDefinition::model_id to const char*
It is valid to have a 48-character model ID on CPUID, however the
definition of X86CPUDefinition::model_id is char[48], which can
make the compiler drop the null terminator from the string.

If a CPU model happens to have 48 bytes on model_id, "-cpu help"
will print garbage and the object_property_set_str() call at
x86_cpu_load_def() will read data outside the model_id array.

We could increase the array size to 49, but this would mean the
compiler would not issue a warning if a 49-char string is used by
mistake for model_id.

To make things simpler, simply change model_id to be const char*,
and validate the string length using an assert() on
x86_register_cpudef_type().

Reported-by: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20180109154519.25634-2-ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2018-01-17 23:04:31 -02:00
..
hvf target-i386: update hflags on Hypervisor.framework 2018-01-16 14:54:51 +01:00
arch_dump.c exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly 2017-09-19 18:21:33 +02:00
arch_memory_mapping.c exec,dump,i386,ppc,s390x: don't include exec/cpu-all.h explicitly 2017-09-19 18:21:33 +02:00
bpt_helper.c
cc_helper_template.h
cc_helper.c
cpu-qom.h i386: refactor KVM cpuid code so that it applies to hvf as well 2017-12-22 15:01:48 +01:00
cpu.c i386: Change X86CPUDefinition::model_id to const char* 2018-01-17 23:04:31 -02:00
cpu.h target/i386: move hflags update code to a function 2018-01-16 14:54:51 +01:00
excp_helper.c
fpu_helper.c
gdbstub.c
hax-all.c target/i386: hax: Move x86_update_hflags. 2018-01-16 14:54:51 +01:00
hax-darwin.c i386/hax: remove duplicated includes 2017-12-18 17:07:02 +03:00
hax-darwin.h i386/hax: remove duplicated includes 2017-12-18 17:07:02 +03:00
hax-i386.h
hax-interface.h
hax-mem.c General warn report fixups 2017-09-19 14:09:34 +02:00
hax-windows.c
hax-windows.h i386/hax: remove duplicated include 2017-12-18 17:07:02 +03:00
helper.c
helper.h
hyperv-proto.h hyperv: add header with protocol definitions 2017-09-19 16:20:49 +02:00
hyperv.c hyperv: add header with protocol definitions 2017-09-19 16:20:49 +02:00
hyperv.h
int_helper.c
kvm_i386.h
kvm-stub.c
kvm.c irq: fix memory leak 2018-01-16 14:54:51 +01:00
machine.c migration: pre_save return int 2017-09-27 11:35:59 +01:00
Makefile.objs i386: hvf: move all hvf files in the same directory 2017-12-22 15:02:05 +01:00
mem_helper.c
misc_helper.c
monitor.c target/i386: fix "info mem" for LA57 mode 2017-09-19 16:20:49 +02:00
mpx_helper.c
ops_sse_header.h
ops_sse.h target/i386: fix phminposuw in-place operation 2017-09-19 14:09:11 +02:00
seg_helper.c
shift_helper_template.h
smm_helper.c
svm_helper.c target/*helper: don't check retaddr before calling cpu_restore_state 2017-12-27 17:20:44 -08:00
svm.h
TODO
trace-events docs: fix broken paths to docs/devel/tracing.txt 2017-07-31 13:12:53 +03:00
translate.c tcg: Remove TCGV_UNUSED* and TCGV_IS_UNUSED* 2017-12-29 12:43:39 -08:00
xsave_helper.c