SlideShare a Scribd company logo
Better IPSec
    Security Association Resolution

               Netconf 2006
                  Tokyo

                James Morris
              jmorris@namei.org


                      
Problem
    a) Outbound packet
    b) Security policy db entry match
    c) No security association in kernel


●
 Most of the time, we return EAGAIN to app or
drop packet if forwarding.
●
 We kick the key manager, and usually have an
SA available for next packet.
                              
Problem...
    ●
        It actually kind of works for one case: blocking
        sendmsg() of datagrams.
    ●
        Process is scheduled in a loop until SA
        resolved. See xfrm_lookup().
    ●
        Does not work for connect(2), so ping and
        many UDP apps just get EAGAIN.




                                
Solution
    ●
        General solution for all protocols and contexts:
        –   connect(2)
        –   sendmsg(2)
        –   forwarding path (tunnel endpoint)
        –   various kernel-generated packets
        –   blocking and non-blocking modes




                                    
Solution...
    ●
        Ideally, we'd like connect(2) to follow Posix
        semantics, for non-blocking this is:
        –   Return EINPROGESS first
        –   Return EALREADY until SA resolved
    ●
        For non-blocking sockets in general, it'd be nice
        to make sure poll(2) works as expected.
        –   even for datagram protocols, as IPSec adds a kind
            of session underneath.

                                   
Solution...
    ●
        sendmsg(2) should return EAGAIN for non-
        blocking case
    ●
        For tunnel end point, we probably need to
        queue packets in a resolution queue.
    ●
        This may also be useful for non-blocking socket
        case.
    ●
        Herbert has suggested larval dst to go with
        larval SA.

                               
Status
    ●
        Current patch contains a lot of instrumentation
        and some initial changes:
        –   Make connect(2) work for the blocking case,
            hooking into ip_route_connect()
        –   Propagate new flags down to xfrm_lookup() to
            control behavior:
             ●
                 Kick the key manager?
             ●
                 Sleep until resolved?



                                          
Ongoing work
    ●
        Continue to develop code to handle all cases
        and protocols
    ●
        Probably involve some code consolidation
    ●
        Determine how much of the problem to solve




                               
Issues
    ●
        Not clear on all of the use-cases for this:
        –   Opportunistic encryption
        –   Complex/large scale policy where pro-active SA
            negotiation overhead would be too high
        –   Others?




                                   

More Related Content

PDF
Fast and Precise Symbolic Analysis of Concurrency Bugs in Device Drivers
PDF
ITFT_Semaphores and bounded buffer
PPT
Synchronization linux
PDF
120827 JAWS-UG Sapporo7 openswanでvpc
PDF
VPNaaS neutron
PDF
IPSec VPN Tutorial Part1
PDF
SELinux Project Overview - Linux Foundation Japan Symposium 2008
PDF
The State of Security Enhanced Linux - FOSS.IN/2007
Fast and Precise Symbolic Analysis of Concurrency Bugs in Device Drivers
ITFT_Semaphores and bounded buffer
Synchronization linux
120827 JAWS-UG Sapporo7 openswanでvpc
VPNaaS neutron
IPSec VPN Tutorial Part1
SELinux Project Overview - Linux Foundation Japan Symposium 2008
The State of Security Enhanced Linux - FOSS.IN/2007

Viewers also liked (8)

PDF
Directions in SELinux Networking
PDF
VTI の中身
PPT
SmartCloud Enterprise: Using a SOCKS Proxy with VLANs
PDF
Mandatory Access Control Networking Update - Netonf 2006 Tokyo
PDF
Secure and Simple Sandboxing in SELinux
PDF
SDN in the Management Plane: OpenConfig and Streaming Telemetry
ODP
Slug 2009 06 SELinux For Sysadmins
ODP
SELinux for Everyday Users
Directions in SELinux Networking
VTI の中身
SmartCloud Enterprise: Using a SOCKS Proxy with VLANs
Mandatory Access Control Networking Update - Netonf 2006 Tokyo
Secure and Simple Sandboxing in SELinux
SDN in the Management Plane: OpenConfig and Streaming Telemetry
Slug 2009 06 SELinux For Sysadmins
SELinux for Everyday Users
Ad

Similar to Better IPSec Security Association Resolution - Netconf 2006 Tokyo (20)

PDF
One Year of Porting - Post-mortem of two Linux/SteamOS launches
PDF
Anatomy of neutron from the eagle eyes of troubelshoorters
PDF
Single Packet Authorization - Slides English
PDF
Layer 7 Firewall on Mikrotik
PPTX
Linux Network Stack
PDF
Fast dynamic analysis, Kostya Serebryany
PDF
Константин Серебряный "Быстрый динамичекский анализ программ на примере поиск...
PDF
cachegrand: A Take on High Performance Caching
ODP
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
PDF
延伸Linux关键业务到双活高速NVMe-oF存储-OpenInfraDays-China2018
PDF
SREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
PDF
Userspace adaptive spinlocks with rseq
PPTX
Memory model
PPTX
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
PDF
Performance optimization techniques for Java code
PDF
pfSense 2.2 Preview - pfSense Hangout November 2014
PDF
Snap - the universal packaging format for linux distros
ODP
Ceph Day Melbourne - Troubleshooting Ceph
PDF
BlackHat 2009 - Hacking Zigbee Chips (slides)
PDF
Streaming huge databases using logical decoding
One Year of Porting - Post-mortem of two Linux/SteamOS launches
Anatomy of neutron from the eagle eyes of troubelshoorters
Single Packet Authorization - Slides English
Layer 7 Firewall on Mikrotik
Linux Network Stack
Fast dynamic analysis, Kostya Serebryany
Константин Серебряный "Быстрый динамичекский анализ программ на примере поиск...
cachegrand: A Take on High Performance Caching
UWE Linux Boot Camp 2007: Hacking embedded Linux on the cheap
延伸Linux关键业务到双活高速NVMe-oF存储-OpenInfraDays-China2018
SREcon Europe 2016 - Full-mesh IPsec network at Hosted Graphite
Userspace adaptive spinlocks with rseq
Memory model
BSides LV 2016 - Beyond the tip of the iceberg - fuzzing binary protocols for...
Performance optimization techniques for Java code
pfSense 2.2 Preview - pfSense Hangout November 2014
Snap - the universal packaging format for linux distros
Ceph Day Melbourne - Troubleshooting Ceph
BlackHat 2009 - Hacking Zigbee Chips (slides)
Streaming huge databases using logical decoding
Ad

More from James Morris (12)

PDF
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
PDF
Adding Extended Attribute Support to NFS
PDF
Linux Kernel Security Overview - KCA 2009
PDF
sVirt: Hardening Linux Virtualization with Mandatory Access Control
PDF
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
PDF
OLPC Networking Overview
PDF
Cryptographic Hardware Support for the Linux Kernel - Netconf 2004
PDF
Kernel Security for 2.8 - Kernel Summit 2004
PDF
How and Why You Should Become a Kernel Hacker - FOSS.IN/2007
PDF
Overview of NSA Security Enhanced Linux - FOSS.IN/2005
PDF
SELinux Kernel Internals and Architecture - FOSS.IN/2005
PDF
Anatomy of Fedora Kiosk Mode (FOSS.MY/2008)
Linux Kernel Security: Adapting 1960s Technology to Meet 21st Century Threats
Adding Extended Attribute Support to NFS
Linux Kernel Security Overview - KCA 2009
sVirt: Hardening Linux Virtualization with Mandatory Access Control
Have You Driven an SELinux Lately? - An Update on the SELinux Project - OLS ...
OLPC Networking Overview
Cryptographic Hardware Support for the Linux Kernel - Netconf 2004
Kernel Security for 2.8 - Kernel Summit 2004
How and Why You Should Become a Kernel Hacker - FOSS.IN/2007
Overview of NSA Security Enhanced Linux - FOSS.IN/2005
SELinux Kernel Internals and Architecture - FOSS.IN/2005
Anatomy of Fedora Kiosk Mode (FOSS.MY/2008)

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Big Data Technologies - Introduction.pptx
Encapsulation_ Review paper, used for researhc scholars
Assigned Numbers - 2025 - Bluetooth® Document
Diabetes mellitus diagnosis method based random forest with bat algorithm
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
“AI and Expert System Decision Support & Business Intelligence Systems”
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Approach and Philosophy of On baking technology
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx

Better IPSec Security Association Resolution - Netconf 2006 Tokyo

  • 1. Better IPSec Security Association Resolution Netconf 2006 Tokyo James Morris jmorris@namei.org    
  • 2. Problem a) Outbound packet b) Security policy db entry match c) No security association in kernel ● Most of the time, we return EAGAIN to app or drop packet if forwarding. ● We kick the key manager, and usually have an SA available for next packet.    
  • 3. Problem... ● It actually kind of works for one case: blocking sendmsg() of datagrams. ● Process is scheduled in a loop until SA resolved. See xfrm_lookup(). ● Does not work for connect(2), so ping and many UDP apps just get EAGAIN.    
  • 4. Solution ● General solution for all protocols and contexts: – connect(2) – sendmsg(2) – forwarding path (tunnel endpoint) – various kernel-generated packets – blocking and non-blocking modes    
  • 5. Solution... ● Ideally, we'd like connect(2) to follow Posix semantics, for non-blocking this is: – Return EINPROGESS first – Return EALREADY until SA resolved ● For non-blocking sockets in general, it'd be nice to make sure poll(2) works as expected. – even for datagram protocols, as IPSec adds a kind of session underneath.    
  • 6. Solution... ● sendmsg(2) should return EAGAIN for non- blocking case ● For tunnel end point, we probably need to queue packets in a resolution queue. ● This may also be useful for non-blocking socket case. ● Herbert has suggested larval dst to go with larval SA.    
  • 7. Status ● Current patch contains a lot of instrumentation and some initial changes: – Make connect(2) work for the blocking case, hooking into ip_route_connect() – Propagate new flags down to xfrm_lookup() to control behavior: ● Kick the key manager? ● Sleep until resolved?    
  • 8. Ongoing work ● Continue to develop code to handle all cases and protocols ● Probably involve some code consolidation ● Determine how much of the problem to solve    
  • 9. Issues ● Not clear on all of the use-cases for this: – Opportunistic encryption – Complex/large scale policy where pro-active SA negotiation overhead would be too high – Others?