---
name: "access_ok"
section: "9"
platform: "linux"
package: "linux-manual-2.6.26"
version: "2.6.26-29"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/access_ok"
---

# access\_ok(9)

Checks if a user space pointer is valid

## NAME

access\_ok - Checks if a user space pointer is valid

## SYNOPSIS

**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.

## DESCRIPTION

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.

## COPYRIGHT
