• Maciej W. Rozycki's avatar
    binfmt_elf: Respect error return from `regset->active' · 2f819db5
    Maciej W. Rozycki authored
    The regset API documented in <linux/regset.h> defines -ENODEV as the
    result of the `->active' handler to be used where the feature requested
    is not available on the hardware found.  However code handling core file
    note generation in `fill_thread_core_info' interpretes any non-zero
    result from the `->active' handler as the regset requested being active.
    Consequently processing continues (and hopefully gracefully fails later
    on) rather than being abandoned right away for the regset requested.
    Fix the problem then by making the code proceed only if a positive
    result is returned from the `->active' handler.
    Signed-off-by: default avatarMaciej W. Rozycki <macro@mips.com>
    Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
    Fixes: 4206d3aa ("elf core dump: notes user_regset")
    Patchwork: https://patchwork.linux-mips.org/patch/19332/
    Cc: Alexander Viro <viro@zeniv.linux.org.uk>
    Cc: James Hogan <jhogan@kernel.org>
    Cc: Ralf Baechle <ralf@linux-mips.org>
    Cc: linux-fsdevel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
binfmt_elf.c 63.8 KB