Message ID | 20210709051710.15831-1-xiyou.wangcong@gmail.com |
---|---|
State | Superseded |
Headers | show |
Series | [net-next] net: use %px to print skb address in trace_netif_receive_skb | expand |
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?
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) )