Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpatch_create_dynamic_rela_sections: 1563: lookup_local_symbol .data..read_mostly (dev.c) #219

Closed
jstancek opened this issue May 29, 2014 · 1 comment

Comments

@jstancek
Copy link
Contributor

I'm getting error with following patch for __netif_receive_skb_core:

diff --git a/net/core/dev.c b/net/core/dev.c
index d06cd72..b7c1300 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3503,6 +3503,7 @@ ncls:
        case RX_HANDLER_PASS:
            break;
        default:
+           printk("BUG!\n");
            BUG();
        }
    }
Copying source to /root/.kpatch/src
Testing patch file
checking file net/core/dev.c
Building original kernel
Building patched kernel
Detecting changed objects
Rebuilding changed objects
Extracting new and modified ELF sections
dev.o: changed function: __netdev_upper_dev_link
dev.o: changed function: __dev_set_promiscuity
dev.o: changed function: rollback_registered_many
dev.o: changed function: net_rx_action
dev.o: changed function: __netif_receive_skb_core
dev.o: changed function: napi_gro_complete
dev.o: changed function: unregister_netdevice_queue
dev.o: changed function: __dev_change_flags
dev.o: changed function: netdev_upper_dev_unlink
dev.o: changed function: netdev_has_upper_dev
dev.o: changed function: netdev_run_todo
dev.o: changed function: dev_set_allmulti
dev.o: changed function: netdev_master_upper_dev_get
dev.o: changed function: netdev_has_any_upper_dev
dev.o: changed function: dev_change_net_namespace
dev.o: changed function: __netdev_update_features
dev.o: changed function: register_netdevice
/usr/local/libexec/kpatch/create-diff-object: kpatch_create_dynamic_rela_sections: 1563: lookup_local_symbol .data..read_mostly (dev.c)
ERROR: kpatch build failed. Check /tmp/kpatch-build-1401370085.log for more details.

@jpoimboe
Copy link
Member

I have a fix for this specific failure, but then this patch shows another failure for which I'll open a new issue:

/home/jpoimboe/git/kpatch/kpatch-build/create-diff-object: kpatch_create_dynamic_rela_sections: 1583: expected bundled symbol for section __jump_table for dynrela src __tracepoint_netif_receive_skb

jpoimboe added a commit to jpoimboe/kpatch that referenced this issue May 29, 2014
Replace .data..read_mostly references with their corresponding symbol
references.

Fixes dynup#219.
jpoimboe added a commit to jpoimboe/kpatch that referenced this issue May 30, 2014
Support patching functions which uses these sections by converting
references to these sections to symbol object references.

Fixes dynup#219.
jpoimboe added a commit to jpoimboe/kpatch that referenced this issue May 30, 2014
The current approach of trying to include the tracepoint-related
sections doesn't work at all.  The new tracepoints don't show up in
"perf list".

And also, with one patch (issue dynup#219) I've seen a panic in
jump_label_del_module().  I suspect it's because the kernel is confused
by dynamic relocations' changing of the jump table after it was
registered with the jump table code.

I think the best approach for now is to just always exclude these
sections.  It should be harmless, with the only consequence being that
tracepoints and jump labels can't be enabled in patched functions (which
is already the case with the current code anyway).

Fixes dynup#221.
jpoimboe added a commit to jpoimboe/kpatch that referenced this issue May 30, 2014
The current approach of trying to include the tracepoint-related
sections doesn't work at all.  The new tracepoints don't show up in
"perf list".

And also, with one patch (issue dynup#219) I've seen a panic in
jump_label_del_module().  I suspect it's because the kernel is confused
by dynamic relocations' changing of the jump table after it was
registered with the jump table code.

I think the best approach for now is to just always exclude these
sections.  It should be harmless, with the only consequence being that
tracepoints and jump labels can't be enabled in patched functions (which
is already the case with the current code anyway).

Fixes dynup#221.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants