• Christoph Hellwig's avatar
    net: optimize the sockptr_t for unified kernel/user address spaces · 6d04fe15
    Christoph Hellwig authored
    For architectures like x86 and arm64 we don't need the separate bit to
    indicate that a pointer is a kernel pointer as the address spaces are
    unified.  That way the sockptr_t can be reduced to a union of two
    pointers, which leads to nicer calling conventions.
    
    The only caveat is that we need to check that users don't pass in kernel
    address and thus gain access to kernel memory.  Thus the USER_SOCKPTR
    helper is replaced with a init_user_sockptr function that does this check
    and returns an error if it fails.
    Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    6d04fe15
sockptr.h 2.79 KB