Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • net
  • socket.c
Find file BlameHistoryPermalink
  • Soheil Hassas Yeganeh's avatar
    tcp: fix SCM_TIMESTAMPING_OPT_STATS for normal skbs · cdaf15b4
    Soheil Hassas Yeganeh authored Mar 18, 2017
    [ Upstream commit 8605330a ]
    
    __sock_recv_timestamp can be called for both normal skbs (for
    receive timestamps) and for skbs on the error queue (for transmit
    timestamps).
    
    Commit 1c885808
    (tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING)
    assumes any skb passed to __sock_recv_timestamp are from
    the error queue, containing OPT_STATS in the content of the skb.
    This results in accessing invalid memory or generating junk
    data.
    
    To fix this, set skb->pkt_type to PACKET_OUTGOING for packets
    on the error queue. This is safe because on the receive path
    on local sockets skb->pkt_type is never set to PACKET_OUTGOING.
    With that, copy OPT_STATS from a packet, only if its pkt_type
    is PACKET_OUTGOING.
    
    Fixes: 1c885808
    
     ("tcp: SOF_TIMESTAMPING_OPT_STATS option for SO_TIMESTAMPING")
    Reported-by: default avatarJongHwan Kim <zzoru007@gmail.com>
    Signed-off-by: default avatarSoheil Hassas Yeganeh <soheil@google.com>
    Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
    Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    cdaf15b4
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7