Zero can be a valid value of num_records. For example, on Intel Atom x6425RE,
only x87 and SSE are supported (features 0, 1), and fpu_user_cfg.max_features
is 3. The for_each_extended_xfeature() loop only iterates feature 2, which is
not enabled, so num_records = 0. This is valid and should not cause core dump
failure.
The issue is that dump_xsave_layout_desc() returns 0 for both genuine errors
(dump_emit() failure) and valid cases (no extended features). Use negative
return values for errors and only abort on genuine failures.
Fixes:
|
||
|---|---|---|
| .. | ||
| Makefile | ||
| bugs.c | ||
| context.h | ||
| core.c | ||
| init.c | ||
| internal.h | ||
| legacy.h | ||
| regset.c | ||
| signal.c | ||
| xstate.c | ||
| xstate.h | ||