Skip to content

fortify_panic with emulated adapter #976

@dkoreshkov

Description

@dkoreshkov

A fortified Linux kernel does not like this line in LINUX/netmap_linux.c:

strcpy(((void *)attr_kind) + NLA_HDRLEN, qdisc_name);

It says:

[  440.419732] 936.282844 [ 320] generic_netmap_register   Emulated adapter for enp12s0f0 activated
[  440.419822] detected buffer overflow in strcpy
[  440.419856] ------------[ cut here ]------------
[  440.419857] Kernel BUG at fortify_panic+0xf/0x20 [verbose debug info unavailable]
[  440.419883] invalid opcode: 0000 [#1] PREEMPT SMP PTI
.......
[  440.420099] Call Trace:
[  440.420108]  <TASK>
[  440.420115]  ? die+0x2d/0x80
[  440.420126]  ? do_trap+0xe1/0x110
[  440.420136]  ? fortify_panic+0xf/0x20
[  440.420146]  ? do_error_trap+0x65/0xa0
[  440.420156]  ? fortify_panic+0xf/0x20
[  440.420166]  ? exc_invalid_op+0x49/0x70
[  440.420178]  ? fortify_panic+0xf/0x20
[  440.420188]  ? asm_exc_invalid_op+0x16/0x20
[  440.420201]  ? fortify_panic+0xf/0x20
[  440.420211]  ? fortify_panic+0xf/0x20
[  440.420222]  tc_configure+0x561/0x570 [netmap]
[  440.420257]  ? nm_os_catch_tx+0x87/0x270 [netmap]

Apparently, GCC cannot grok the destination buffer size in that case.
Temporarily fixed by a simple copy loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions