Message ID | 20210709051710.15831-1-xiyou.wangcong@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: use %px to print skb address in trace_netif_receive_skb | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | warning | 2 maintainers not CCed: mingo@redhat.com rostedt@goodmis.org |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 10 this patch: 10 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | warning | CHECK: Alignment should match open parenthesis WARNING: 'adress' may be misspelled - perhaps 'address'? |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 10 this patch: 10 |
netdev/header_inline | success | Link |
From: Cong Wang <xiyou.wangcong@gmail.com> Date: Thu, 8 Jul 2021 22:17:08 -0700 > From: Qitao Xu <qitao.xu@bytedance.com> > > The print format of skb adress in tracepoint class net_dev_template > is changed to %px from %p, because we want to use skb address > as a quick way to identify a packet. > > Reviewed-by: Cong Wang <cong.wang@bytedance.com> > Signed-off-by: Qitao Xu <qitao.xu@bytedance.com> Aren't we not supposed to leak kernel addresses to userspace?
On Fri, Jul 9, 2021 at 1:16 AM David Miller <davem@davemloft.net> wrote: > > From: Cong Wang <xiyou.wangcong@gmail.com> > Date: Thu, 8 Jul 2021 22:17:08 -0700 > > > From: Qitao Xu <qitao.xu@bytedance.com> > > > > The print format of skb adress in tracepoint class net_dev_template > > is changed to %px from %p, because we want to use skb address > > as a quick way to identify a packet. > > > > Reviewed-by: Cong Wang <cong.wang@bytedance.com> > > Signed-off-by: Qitao Xu <qitao.xu@bytedance.com> > > Aren't we not supposed to leak kernel addresses to userspace? Right, but trace ring buffer is only accessible to privileged users, so leaking it to root is not a problem. Thanks.
From: Cong Wang <xiyou.wangcong@gmail.com> Date: Fri, 9 Jul 2021 11:59:43 -0700 > On Fri, Jul 9, 2021 at 1:16 AM David Miller <davem@davemloft.net> wrote: >> >> From: Cong Wang <xiyou.wangcong@gmail.com> >> Date: Thu, 8 Jul 2021 22:17:08 -0700 >> >> > From: Qitao Xu <qitao.xu@bytedance.com> >> > >> > The print format of skb adress in tracepoint class net_dev_template >> > is changed to %px from %p, because we want to use skb address >> > as a quick way to identify a packet. >> > >> > Reviewed-by: Cong Wang <cong.wang@bytedance.com> >> > Signed-off-by: Qitao Xu <qitao.xu@bytedance.com> >> >> Aren't we not supposed to leak kernel addresses to userspace? > > Right, but trace ring buffer is only accessible to privileged users, > so leaking it to root is not a problem. Please explain this in your commit msgs and resubmit. Thank you.
diff --git a/include/trace/events/net.h b/include/trace/events/net.h index 2399073c3afc..78c448c6ab4c 100644 --- a/include/trace/events/net.h +++ b/include/trace/events/net.h @@ -136,7 +136,7 @@ DECLARE_EVENT_CLASS(net_dev_template, __assign_str(name, skb->dev->name); ), - TP_printk("dev=%s skbaddr=%p len=%u", + TP_printk("dev=%s skbaddr=%px len=%u", __get_str(name), __entry->skbaddr, __entry->len) )