access_ok(9)

access_ok9

Checks if a user space pointer is valid

Usage

access_ok(type, addr, size);

Arguments

type

Type of access: VERIFY_READ or VERIFY_WRITE. Note that VERIFY_WRITE is a superset of VERIFY_READ - if it is safe to write to a block, it is always safe to read from it.

addr

User space pointer to start of block to check

size

Size of block to check

Context

User context only. This function may sleep.

Overview

Checks if a pointer to a block of memory in user space is valid.

Returns true (nonzero) if the memory block may be valid, false (zero) if it is definitely invalid.

Note that, depending on architecture, this function probably just checks that the pointer is in the user space range - after calling this function, memory access functions may still return -EFAULT.

Releases

2 releases since Debian 4.0 (Etch); the text changed 1 time.

  1. 4.0
  2. 5.0

From linux-manual-2.6.26 2.6.26-29 in Debian 5.0 (Lenny). Parsed by carta from the page's man source.