Top Qs
Timeline
Chat
Perspective
Io uring
Linux kernel interface for storage devices From Wikipedia, the free encyclopedia
Remove ads
io_uring[a] is a Linux kernel system call interface for storage device asynchronous I/O operations addressing performance issues with similar interfaces provided by functions like read()
/write()
or aio_read()
/aio_write()
etc. for operations on data accessed by file descriptors.[2][3]: 2
Development is ongoing, worked on primarily by Jens Axboe at Meta.[2]
Remove ads
Interface
It works by creating two circular buffers, called "queue rings", to track the submission and completion of I/O requests, respectively. For storage devices, these are called the submission queue (SQ) and completion queue (CQ).[4] Keeping these buffers shared between the kernel and application helps to boost the I/O performance by eliminating the need to issue extra and expensive system calls to copy these buffers between the two.[2][4][5] According to the io_uring design paper, the SQ buffer is writable only by consumer applications, and the CQ buffer is writable only by the kernel.[2]: 3
Remove ads
History
The Linux kernel has supported asynchronous I/O since version 2.5, but it was seen as difficult to use and inefficient.[7] This older API only supported certain niche use cases,[8] notably it only enables asynchronous operation when using the O_DIRECT flag and while accessing already allocated files. This prevents utilizing the page cache, while also exposing the application to complex O_DIRECT semantics. Linux AIO also does not support sockets, so it cannot be used to multiplex network and disk I/O.[9]
The io_uring kernel interface was adopted in Linux kernel version 5.1 to resolve the deficiencies of Linux AIO.[2][5][10] The liburing library provides an API to interact with the kernel interface easily from userspace.[2]: 12
Remove ads
Security
io_uring has been noted for exposing a significant attack surface and structural difficulties integrating it with the Linux security subsystem.[11]
In June 2023, Google's security team reported that 60% of the exploits submitted to their bug bounty program in 2022 were exploits of the Linux kernel's io_uring vulnerabilities. As a result, io_uring
was disabled for apps in Android, and disabled entirely in ChromeOS as well as Google servers.[12] Docker also consequently disabled io_uring from their default seccomp profile.[13]
Although initial async offload design in io_uring could be problematic, later kernels changed the thread model. After such improvements, there were no known inherent problems with it and its development is very careful with new features. Considering that a performant async framework with a user facing API is complex, it was to be expected that issues would be found initially. After initial issues have been addressed, it any less secure than anything else in the kernel and io_uring acceptance quickly grew in production. Some of its criticism are also based on wrong or outdated assumptions.[14]
Notes
- Input/output user ring[1]
References
External links
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads