Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
setjmp/ | H | - | - | 964 | 526 | |
README.zfs | H A D | 27-Mar-2025 | 3.4 KiB | 82 | 66 | |
lapi.c | H A D | 27-Mar-2025 | 30.4 KiB | 1,324 | 1,062 | |
lapi.h | H A D | 27-Mar-2025 | 577 | 26 | 11 | |
lauxlib.c | H A D | 27-Mar-2025 | 22.2 KiB | 800 | 548 | |
lbaselib.c | H A D | 27-Mar-2025 | 7.2 KiB | 296 | 232 | |
lcode.c | H A D | 27-Mar-2025 | 22.1 KiB | 888 | 730 | |
lcode.h | H A D | 27-Mar-2025 | 3.1 KiB | 85 | 55 | |
lcompat.c | H A D | 27-Mar-2025 | 1.5 KiB | 103 | 85 | |
lcorolib.c | H A D | 27-Mar-2025 | 3.6 KiB | 159 | 124 | |
lctype.c | H A D | 27-Mar-2025 | 2.3 KiB | 52 | 40 | |
lctype.h | H A D | 27-Mar-2025 | 1.8 KiB | 94 | 38 | |
ldebug.c | H A D | 27-Mar-2025 | 16.1 KiB | 609 | 501 | |
ldebug.h | H A D | 27-Mar-2025 | 1.1 KiB | 36 | 17 | |
ldo.c | H A D | 27-Mar-2025 | 22.6 KiB | 764 | 616 | |
ldo.h | H A D | 27-Mar-2025 | 1.5 KiB | 47 | 26 | |
lfunc.c | H A D | 27-Mar-2025 | 4.2 KiB | 160 | 123 | |
lfunc.h | H A D | 27-Mar-2025 | 1 KiB | 35 | 18 | |
lgc.c | H A D | 27-Mar-2025 | 36.9 KiB | 1,218 | 841 | |
lgc.h | H A D | 27-Mar-2025 | 5.3 KiB | 159 | 77 | |
llex.c | H A D | 27-Mar-2025 | 15 KiB | 531 | 420 | |
llex.h | H A D | 27-Mar-2025 | 2.2 KiB | 83 | 49 | |
llimits.h | H A D | 27-Mar-2025 | 7.7 KiB | 314 | 150 | |
lmem.c | H A D | 27-Mar-2025 | 2.6 KiB | 98 | 55 | |
lmem.h | H A D | 27-Mar-2025 | 1.8 KiB | 56 | 28 | |
lobject.c | H A D | 27-Mar-2025 | 7.7 KiB | 282 | 223 | |
lobject.h | H A D | 27-Mar-2025 | 14.6 KiB | 608 | 316 | |
lopcodes.c | H A D | 27-Mar-2025 | 3 KiB | 108 | 89 | |
lopcodes.h | H A D | 27-Mar-2025 | 8.3 KiB | 290 | 124 | |
lparser.c | H A D | 27-Mar-2025 | 45.2 KiB | 1,643 | 1,269 | |
lparser.h | H A D | 27-Mar-2025 | 3.3 KiB | 121 | 81 | |
lstate.c | H A D | 27-Mar-2025 | 7.5 KiB | 320 | 228 | |
lstate.h | H A D | 27-Mar-2025 | 7.5 KiB | 230 | 140 | |
lstring.c | H A D | 27-Mar-2025 | 4.8 KiB | 186 | 122 | |
lstring.h | H A D | 27-Mar-2025 | 1.3 KiB | 48 | 20 | |
lstrlib.c | H A D | 27-Mar-2025 | 28.3 KiB | 1,040 | 849 | |
ltable.c | H A D | 27-Mar-2025 | 16.2 KiB | 592 | 413 | |
ltable.h | H A D | 27-Mar-2025 | 1.4 KiB | 47 | 27 | |
ltablib.c | H A D | 27-Mar-2025 | 7.6 KiB | 289 | 222 | |
ltm.c | H A D | 27-Mar-2025 | 1.8 KiB | 76 | 52 | |
ltm.h | H A D | 27-Mar-2025 | 1.1 KiB | 59 | 34 | |
lvm.c | H A D | 27-Mar-2025 | 30.1 KiB | 931 | 787 | |
lvm.h | H A D | 27-Mar-2025 | 1.5 KiB | 46 | 25 | |
lzio.c | H A D | 27-Mar-2025 | 1.6 KiB | 74 | 54 | |
lzio.h | H A D | 27-Mar-2025 | 1.5 KiB | 67 | 34 |
README.zfs
1# SPDX-License-Identifier: CDDL-1.0 2# 3# CDDL HEADER START 4# 5# This file and its contents are supplied under the terms of the 6# Common Development and Distribution License ("CDDL"), version 1.0. 7# You may only use this file in accordance with the terms of version 8# 1.0 of the CDDL. 9# 10# A full copy of the text of the CDDL should have accompanied this 11# source. A copy of the CDDL is also available via the Internet at 12# http://www.illumos.org/license/CDDL. 13# 14# CDDL HEADER END 15# 16 17# 18# Copyright (c) 2017 by Delphix. All rights reserved. 19# 20 21Introduction 22------------ 23 24This README describes the Lua interpreter source code that lives in the ZFS 25source tree to enable execution of ZFS channel programs, including its 26maintenance policy, the modifications that have been made to it, and how it 27should (and should not) be used. 28 29For a description of the Lua language and features exposed by ZFS channel 30programs, please refer to the zfs-program(1m) man page instead. 31 32 33Maintenance policy 34------------------ 35 36The Lua runtime is considered stable software. Channel programs don't need much 37complicated logic, so updates to the Lua runtime from upstream are viewed as 38nice-to-have, but not required for channel programs to be well-supported. As 39such, the Lua runtime in ZFS should be updated on an as-needed basis for 40security vulnerabilities, but not much else. 41 42 43Modifications to Lua 44-------------------- 45 46The version of the Lua runtime we're using in ZFS has been modified in a variety 47of ways to make it more useful for the specific purpose of running channel 48programs. These changes include: 49 501. "Normal" Lua uses floating point for all numbers it stores, but those aren't 51 useful inside ZFS / the kernel. We have changed the runtime to use int64_t 52 throughout for all numbers. 532. Some of the Lua standard libraries do file I/O or spawn processes, but 54 neither of these make sense from inside channel programs. We have removed 55 those libraries rather than reimplementing them using kernel APIs. 563. The "normal" Lua runtime handles errors by failing fatally, but since this 57 version of Lua runs inside the kernel we must handle these failures and 58 return meaningful error codes to userland. We have customized the Lua 59 failure paths so that they aren't fatal. 604. Running poorly-vetted code inside the kernel is always a risk; even if the 61 ability to do so is restricted to the root user, it's still possible to write 62 an incorrect program that results in an infinite loop or massive memory use. 63 We've added new protections into the Lua interpreter to limit the runtime 64 (measured in number of Lua instructions run) and memory overhead of running 65 a channel program. 665. The Lua bytecode is not designed to be secure / safe, so it would be easy to 67 pass invalid bytecode which can panic the kernel. By comparison, the parser 68 is hardened and fails gracefully on invalid input. Therefore, we only accept 69 Lua source code at the ioctl level and then interpret it inside the kernel. 70 71Each of these modifications have been tested in the zfs-test suite. If / when 72new modifications are made, new tests should be added to the suite located in 73zfs-tests/tests/functional/channel_program/lua_core. 74 75 76How to use this Lua interpreter 77------------------------------- 78 79From the above, it should be clear that this is not a general-purpose Lua 80interpreter. Additional work would be required to extricate this custom version 81of Lua from ZFS and make it usable by other areas of the kernel. 82