diff --git a/driver/syscall_compat_aarch64.h b/driver/syscall_compat_aarch64.h index 40a5ae7c06..4d7af2baea 100644 --- a/driver/syscall_compat_aarch64.h +++ b/driver/syscall_compat_aarch64.h @@ -1,3 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + +Copyright (C) 2023 The Falco Authors. + +This file is dual licensed under either the MIT or GPL 2. See MIT.txt +or GPL2.txt for full copies of the license. + +*/ + +/* + * This file was automatically created by syscalls-bumper (https://github.com/falcosecurity/syscalls-bumper).") + * DO NOT EDIT THIS FILE MANUALLY.") + */ + #pragma once #ifndef __NR_io_setup #define __NR_io_setup 0 diff --git a/driver/syscall_compat_s390x.h b/driver/syscall_compat_s390x.h index a3a7f8cdc3..c174795e36 100644 --- a/driver/syscall_compat_s390x.h +++ b/driver/syscall_compat_s390x.h @@ -1,3 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + +Copyright (C) 2023 The Falco Authors. + +This file is dual licensed under either the MIT or GPL 2. See MIT.txt +or GPL2.txt for full copies of the license. + +*/ + +/* + * This file was automatically created by syscalls-bumper (https://github.com/falcosecurity/syscalls-bumper).") + * DO NOT EDIT THIS FILE MANUALLY.") + */ + #pragma once #ifndef __NR_exit #define __NR_exit 1 diff --git a/driver/syscall_compat_x86_64.h b/driver/syscall_compat_x86_64.h index 3157667508..114a00cfb0 100644 --- a/driver/syscall_compat_x86_64.h +++ b/driver/syscall_compat_x86_64.h @@ -1,3 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + +Copyright (C) 2023 The Falco Authors. + +This file is dual licensed under either the MIT or GPL 2. See MIT.txt +or GPL2.txt for full copies of the license. + +*/ + +/* + * This file was automatically created by syscalls-bumper (https://github.com/falcosecurity/syscalls-bumper).") + * DO NOT EDIT THIS FILE MANUALLY.") + */ + #pragma once #ifndef __NR_read #define __NR_read 0 diff --git a/driver/syscall_ia32_64_map.c b/driver/syscall_ia32_64_map.c index 6b8ea79c09..9d6413dd6c 100644 --- a/driver/syscall_ia32_64_map.c +++ b/driver/syscall_ia32_64_map.c @@ -1,3 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT +/* + +Copyright (C) 2023 The Falco Authors. + +This file is dual licensed under either the MIT or GPL 2. See MIT.txt +or GPL2.txt for full copies of the license. + +*/ + /* * This file was automatically created by syscalls-bumper (https://github.com/falcosecurity/syscalls-bumper).") * DO NOT EDIT THIS FILE MANUALLY.") @@ -8,447 +18,439 @@ /* * This table is used by drivers when receiving a 32bit syscall. * It is needed to convert a 32bit syscall (the array index) to a 64bit syscall value. + * NOTE: some syscalls might be unavailable on x86_64; their value will be set to -1. + * Some unavailable syscalls are identical to a compatible x86_64 syscall; in those cases, + * we use the compatible x86_64 syscall, eg: mmap2 -> mmap. */ const int g_ia32_64_map[SYSCALL_TABLE_SIZE] = { - [91] = 11, - [212] = -1, - [385] = 333, - [404] = -1, - [220] = 217, - [89] = -1, - [139] = 123, - [97] = 141, - [108] = 5, - [117] = -1, - [237] = 199, - [367] = 51, - [374] = 323, + [396] = 31, + [315] = 276, + [286] = 248, + [394] = 66, + [5] = 2, + [167] = 178, + [302] = 264, [399] = 68, - [366] = 54, - [269] = -1, - [289] = 251, - [334] = 296, - [361] = 49, - [296] = 258, - [414] = -1, - [204] = -1, - [33] = 21, - [120] = 56, - [188] = 181, - [2] = 57, - [134] = -1, - [376] = 325, - [84] = -1, - [152] = 151, - [362] = 42, - [259] = 222, - [383] = 332, - [34] = -1, - [74] = 170, - [405] = -1, - [319] = 281, - [421] = -1, - [238] = 200, - [185] = 126, + [84] = -1, // ia32 only: oldlstat + [107] = 6, [79] = 164, - [132] = 121, - [181] = 18, - [335] = 297, - [356] = 319, - [50] = 108, - [299] = 261, - [349] = 312, - [46] = 106, - [184] = 125, - [327] = 289, - [438] = 438, - [110] = 172, - [339] = 301, - [373] = 48, - [413] = -1, - [430] = 430, - [138] = 122, - [277] = 240, - [286] = 248, - [96] = 140, - [109] = -1, - [218] = 27, - [239] = -1, + [281] = 244, + [166] = -1, // ia32 only: vm86 + [162] = 35, + [278] = 241, + [127] = 174, [14] = 133, - [111] = 153, - [378] = 327, - [328] = 290, - [428] = 428, - [195] = -1, - [205] = -1, - [227] = 189, - [231] = 193, - [322] = 283, - [92] = 76, - [193] = -1, - [303] = 265, - [419] = -1, - [351] = 314, - [425] = 425, - [44] = -1, - [78] = 96, - [187] = 40, - [203] = -1, - [265] = 228, - [128] = 175, - [250] = 221, - [324] = 285, - [125] = 10, - [267] = 230, - [310] = 272, - [101] = 173, - [262] = 225, - [424] = 424, + [209] = -1, // ia32 only: getresuid32 [3] = 0, - [38] = 82, - [52] = 166, + [319] = 281, + [244] = 211, + [221] = -1, // ia32 only: fcntl64 [85] = 89, - [235] = 197, - [338] = 300, - [352] = 315, - [287] = 249, - [305] = 267, - [320] = 280, - [27] = 37, - [275] = 239, - [420] = -1, - [51] = 163, - [53] = -1, - [54] = 16, - [119] = -1, - [176] = 127, - [336] = 298, [159] = 146, - [234] = 196, - [278] = 241, - [57] = 109, - [189] = 182, - [270] = 234, - [272] = -1, - [16] = 94, - [7] = -1, - [87] = 167, - [175] = 14, - [398] = 67, - [450] = 450, - [58] = -1, - [105] = 36, - [115] = 168, - [298] = 260, - [435] = 435, - [11] = 59, - [127] = 174, - [136] = 135, - [166] = -1, - [266] = 229, + [263] = 226, + [96] = 140, + [416] = -1, // ia32 only: io_pgetevents_time64 + [365] = 55, + [293] = 255, + [201] = -1, // ia32 only: geteuid32 + [438] = 438, [321] = 282, - [43] = 100, - [83] = 88, + [307] = 269, + [183] = 79, + [353] = 316, + [81] = 116, + [300] = -1, // ia32 only: fstatat64 + [132] = 121, + [199] = -1, // ia32 only: getuid32 + [170] = 119, + [106] = 4, + [51] = 163, + [433] = 433, + [129] = 176, + [19] = 8, + [61] = 161, + [406] = -1, // ia32 only: clock_getres_time64 + [442] = 442, + [36] = 162, + [325] = 286, + [55] = 72, + [246] = 207, + [15] = 90, + [447] = 447, + [25] = -1, // ia32 only: stime + [231] = 193, + [444] = 444, + [351] = 314, + [398] = 67, + [425] = 425, + [317] = 279, + [236] = 198, [350] = 313, - [429] = 429, - [230] = 192, - [233] = 195, - [5] = 2, - [68] = -1, + [349] = 312, + [20] = 39, + [196] = -1, // ia32 only: lstat64 + [274] = 237, [168] = 7, - [172] = 157, - [216] = -1, - [22] = -1, - [343] = 305, - [12] = 80, - [82] = 23, + [379] = 328, + [451] = 451, + [207] = -1, // ia32 only: fchown32 + [309] = 271, + [134] = -1, // ia32 only: bdflush + [296] = 258, + [67] = -1, // ia32 only: sigaction + [271] = 235, + [264] = 227, + [105] = 36, + [80] = 115, + [247] = 208, + [418] = -1, // ia32 only: mq_timedsend_time64 + [180] = 17, + [287] = 249, + [160] = 147, + [8] = 85, + [197] = -1, // ia32 only: fstat64 + [303] = 265, + [280] = 243, + [186] = 131, + [185] = 126, + [422] = -1, // ia32 only: futex_time64 + [28] = -1, // ia32 only: oldfstat + [382] = 331, + [417] = -1, // ia32 only: recvmmsg_time64 + [115] = 168, + [252] = 231, + [76] = 97, + [318] = 309, + [414] = -1, // ia32 only: ppoll_time64 [131] = 179, - [386] = 334, - [29] = 34, - [63] = 33, + [182] = 92, + [266] = 229, + [126] = -1, // ia32 only: sigprocmask + [200] = -1, // ia32 only: getgid32 + [121] = 171, + [176] = 127, + [393] = 64, + [210] = -1, // ia32 only: setresgid32 + [213] = -1, // ia32 only: setuid32 + [373] = 48, + [328] = 290, + [9] = 86, + [421] = -1, // ia32 only: rt_sigtimedwait_time64 + [408] = -1, // ia32 only: timer_gettime64 + [255] = 233, + [324] = 285, + [154] = 142, + [383] = 332, + [220] = 217, + [369] = 44, + [198] = -1, // ia32 only: lchown32 + [34] = -1, // ia32 only: nice + [381] = 330, + [284] = 247, + [49] = 107, + [363] = 50, + [64] = 110, + [395] = 29, + [448] = 448, + [314] = 277, + [370] = 46, + [226] = 188, + [73] = -1, // ia32 only: sigpending [133] = 81, - [442] = 442, - [444] = 444, - [129] = 176, - [148] = 75, + [385] = 333, + [360] = 53, + [92] = 76, + [120] = 56, + [155] = 143, + [227] = 189, + [323] = 284, + [150] = 149, + [158] = 24, + [262] = 225, + [27] = 37, + [234] = 196, + [358] = 322, + [291] = 253, [241] = 203, - [249] = 210, - [368] = 52, - [226] = 188, - [346] = 308, - [382] = 331, - [180] = 17, - [196] = -1, - [417] = -1, - [23] = 105, - [116] = 99, - [130] = 177, - [18] = -1, + [420] = -1, // ia32 only: semtimedop_time64 + [139] = 123, + [359] = 41, + [62] = 136, + [94] = 91, + [355] = 318, + [452] = 452, + [304] = 266, + [128] = 175, + [248] = 209, + [39] = 83, + [184] = 125, [93] = 77, - [282] = 245, - [395] = 29, - [410] = -1, - [146] = 20, - [200] = -1, - [221] = -1, - [142] = -1, - [411] = -1, - [0] = 219, - [64] = 110, - [86] = 134, + [181] = 18, + [254] = 213, + [77] = 98, + [38] = 82, + [344] = 306, + [237] = 199, + [89] = -1, // ia32 only: readdir + [148] = 75, + [270] = 234, + [23] = 105, + [30] = 132, + [205] = -1, // ia32 only: getgroups32 + [172] = 157, + [401] = 70, + [46] = 106, [104] = 38, - [144] = 26, - [207] = -1, - [288] = 250, - [363] = 50, - [294] = 256, - [24] = 102, - [123] = 154, - [381] = 330, - [422] = -1, - [165] = 118, - [431] = 431, - [122] = 63, - [158] = 24, - [292] = 254, - [314] = 277, - [402] = 71, - [400] = 69, - [13] = 201, - [213] = -1, + [346] = 308, + [366] = 54, + [376] = 325, + [192] = 9, // NOTE: syscall unmapped on x86_64, forcefully mapped to compatible syscall. See syscalls-bumper bumpIA32to64Map() call. + [261] = 224, [316] = 278, + [63] = 33, + [368] = 52, + [1] = 60, + [229] = 191, + [258] = 218, + [219] = 28, + [109] = -1, // ia32 only: olduname + [21] = 165, + [42] = 22, + [0] = 219, + [2] = 57, + [240] = 202, + [371] = 45, + [215] = -1, // ia32 only: setfsuid32 + [409] = -1, // ia32 only: timer_settime64 + [86] = 134, + [78] = 96, + [288] = 250, + [206] = -1, // ia32 only: setgroups32 + [68] = -1, // ia32 only: sgetmask + [446] = 446, + [375] = 324, + [82] = 23, + [450] = 450, + [233] = 195, + [361] = 49, + [343] = 305, + [428] = 428, [65] = 111, - [164] = 117, - [208] = -1, - [397] = 30, - [37] = 62, - [169] = 180, - [167] = 178, - [318] = 309, - [345] = 307, - [436] = 436, - [41] = 32, - [246] = 207, - [35] = -1, - [199] = -1, - [202] = -1, - [151] = 150, - [197] = -1, - [215] = -1, - [311] = 273, - [445] = 445, - [124] = 159, - [326] = 287, - [372] = 47, - [359] = 41, - [103] = 103, - [141] = 78, - [306] = 268, - [236] = 198, - [31] = -1, - [170] = 119, - [62] = 136, - [406] = -1, + [279] = 242, + [380] = 329, + [238] = 200, + [4] = 1, + [308] = 270, + [69] = -1, // ia32 only: ssetmask + [407] = -1, // ia32 only: clock_nanosleep_time64 [40] = 84, - [80] = 115, - [257] = 216, - [371] = 45, - [403] = -1, - [329] = 291, - [81] = 116, - [219] = 28, - [284] = 247, - [317] = 279, - [423] = -1, - [206] = -1, - [225] = 187, - [56] = -1, - [173] = 15, - [55] = 72, - [232] = 194, - [274] = 237, - [280] = 243, - [355] = 318, - [28] = -1, - [73] = -1, + [174] = 13, [157] = 145, - [177] = 128, - [315] = 276, - [19] = 8, - [67] = -1, - [300] = -1, - [377] = 326, - [20] = 39, - [135] = 139, + [70] = 113, + [250] = 221, + [145] = 19, + [333] = 295, + [225] = 187, + [320] = 280, + [339] = 301, + [331] = 293, + [230] = 192, + [116] = 99, + [439] = 439, + [269] = -1, // ia32 only: fstatfs64 + [47] = 104, + [165] = 118, + [445] = 445, + [97] = 141, + [119] = -1, // ia32 only: sigreturn + [362] = 42, + [272] = -1, // ia32 only: fadvise64_64 + [204] = -1, // ia32 only: setregid32 [149] = 156, + [6] = 3, + [336] = 298, + [100] = 138, + [101] = 173, + [301] = 263, + [374] = 323, + [7] = -1, // ia32 only: waitpid + [253] = 212, + [179] = 130, + [306] = 268, + [449] = 449, + [372] = 47, + [412] = -1, // ia32 only: utimensat_time64 + [143] = 73, + [152] = 151, + [136] = 135, + [124] = 159, + [384] = 158, + [112] = -1, // ia32 only: idle + [171] = 120, [224] = 186, - [437] = 437, + [342] = 304, + [217] = 155, + [335] = 297, + [260] = 223, + [41] = 32, + [54] = 16, + [367] = 51, + [208] = -1, // ia32 only: setresuid32 + [289] = 251, + [277] = 240, + [178] = 129, + [11] = 59, + [275] = 239, + [345] = 307, + [99] = 137, + [410] = -1, // ia32 only: timerfd_gettime64 + [283] = 246, + [337] = 299, + [348] = 311, + [177] = 128, + [267] = 230, + [430] = 430, + [151] = 150, + [249] = 210, + [125] = 10, [347] = 310, - [440] = 440, - [446] = 446, + [326] = 287, + [338] = 300, + [424] = 424, + [13] = 201, + [411] = -1, // ia32 only: timerfd_settime64 + [37] = 62, + [75] = 160, + [202] = -1, // ia32 only: getegid32 + [146] = 20, + [45] = 12, [95] = 93, - [211] = -1, - [242] = 204, + [59] = -1, // ia32 only: oldolduname + [74] = 170, + [60] = 95, + [357] = 321, + [123] = 154, + [203] = -1, // ia32 only: setreuid32 + [190] = 58, + [110] = 172, + [29] = 34, + [216] = -1, // ia32 only: setfsgid32 + [33] = 21, + [211] = -1, // ia32 only: getresgid32 + [114] = 61, + [402] = 71, + [341] = 303, + [135] = 139, + [103] = 103, + [130] = 177, + [50] = 108, + [434] = 434, + [173] = 15, + [102] = -1, // ia32 only: socketcall + [377] = 326, + [147] = 124, + [141] = 78, + [276] = 238, + [243] = 205, + [57] = 109, + [431] = 431, + [228] = 190, + [299] = 261, [290] = 252, - [330] = 292, - [254] = 213, - [295] = 257, - [354] = 317, - [160] = 147, - [161] = 148, - [182] = 92, - [240] = 202, - [245] = 206, + [443] = 443, [66] = 112, - [312] = 274, - [340] = 302, - [344] = 306, + [397] = 30, + [322] = 283, + [441] = 441, [432] = 432, - [228] = 190, - [247] = 208, - [325] = 286, - [154] = 142, - [209] = -1, - [357] = 321, - [6] = 3, - [291] = 253, - [348] = 311, - [17] = -1, - [59] = -1, - [253] = 212, - [276] = 238, - [412] = -1, - [98] = -1, - [178] = 129, - [191] = -1, - [375] = 324, - [379] = 328, - [118] = 74, - [248] = 209, - [9] = 86, - [401] = 70, - [76] = 97, - [210] = -1, - [263] = 226, - [26] = 101, - [107] = 6, - [121] = 171, - [155] = 143, - [268] = -1, - [42] = 22, - [49] = 107, - [313] = 275, - [77] = 98, - [283] = 246, - [369] = 44, + [257] = 216, [10] = 87, - [48] = -1, - [94] = 91, + [214] = -1, // ia32 only: setgid32 + [122] = 63, + [191] = -1, // ia32 only: ugetrlimit + [52] = 166, + [48] = -1, // ia32 only: signal + [268] = -1, // ia32 only: statfs64 + [282] = 245, + [332] = 294, + [245] = 206, + [437] = 437, + [329] = 291, + [117] = -1, // ia32 only: ipc + [356] = 319, + [83] = 88, + [354] = 317, + [87] = 167, + [118] = 74, + [400] = 69, + [435] = 435, + [24] = 102, + [43] = 100, + [111] = 153, + [212] = -1, // ia32 only: chown32 + [265] = 228, + [298] = 260, + [327] = 289, + [436] = 436, + [330] = 292, + [169] = 180, + [235] = 197, + [12] = 80, + [405] = -1, // ia32 only: clock_adjtime64 + [164] = 117, + [187] = 40, + [138] = 122, + [18] = -1, // ia32 only: oldstat + [72] = -1, // ia32 only: sigsuspend + [364] = 288, + [403] = -1, // ia32 only: clock_gettime64 + [259] = 222, + [22] = -1, // ia32 only: umount + [91] = 11, + [71] = 114, + [239] = -1, // ia32 only: sendfile64 + [294] = 256, [163] = 25, - [433] = 433, - [8] = 85, - [126] = -1, - [380] = 329, - [337] = 299, - [21] = 165, - [102] = -1, - [143] = 73, - [179] = 130, - [201] = -1, - [217] = 155, - [147] = 124, - [162] = 35, - [304] = 266, - [308] = 270, - [443] = 443, - [106] = 4, - [114] = 61, + [195] = -1, // ia32 only: stat64 + [108] = 5, + [426] = 426, + [88] = 169, + [194] = -1, // ia32 only: ftruncate64 + [90] = 9, + [242] = 204, [156] = 144, - [396] = 31, + [429] = 429, + [378] = 327, [427] = 427, - [145] = 19, - [255] = 233, - [271] = 235, - [360] = 53, - [407] = -1, - [393] = 64, - [1] = 60, - [113] = -1, - [243] = 205, - [333] = 295, - [365] = 55, - [447] = 447, - [71] = 114, - [171] = 120, - [293] = 255, - [364] = 288, - [252] = 231, - [370] = 46, - [408] = -1, - [434] = 434, - [449] = 449, + [295] = 257, + [175] = 14, + [404] = -1, // ia32 only: clock_settime64 + [292] = 254, [153] = 152, + [305] = 267, + [193] = -1, // ia32 only: truncate64 + [310] = 272, + [16] = 94, + [144] = 26, + [419] = -1, // ia32 only: mq_timedreceive_time64 + [340] = 302, + [440] = 440, + [313] = 275, + [113] = -1, // ia32 only: vm86old [256] = 232, - [418] = -1, - [32] = -1, - [47] = 104, - [183] = 79, - [258] = 218, - [384] = 158, - [140] = -1, - [302] = 264, - [307] = 269, - [441] = 441, - [39] = 83, - [88] = 169, - [416] = -1, - [448] = 448, - [281] = 244, - [451] = 451, - [150] = 149, - [358] = 322, - [30] = 132, - [137] = 183, - [186] = 131, - [439] = 439, - [15] = 90, - [75] = 160, - [174] = 13, - [192] = -1, - [273] = 236, - [90] = 9, - [100] = 138, - [112] = -1, - [244] = 211, - [309] = 271, - [301] = 263, - [331] = 293, - [70] = 113, - [99] = 137, - [198] = -1, - [332] = 294, - [426] = 426, - [45] = 12, - [72] = -1, - [214] = -1, - [260] = 223, - [342] = 304, - [409] = -1, - [279] = 242, - [323] = 284, - [36] = 162, - [69] = -1, - [194] = -1, - [341] = 303, - [394] = 66, - [61] = 161, - [261] = 224, - [60] = 95, + [312] = 274, + [26] = 101, + [311] = 273, + [188] = 181, + [218] = 27, + [334] = 296, + [413] = -1, // ia32 only: pselect6_time64 + [386] = 334, + [232] = 194, [297] = 259, - [353] = 316, - [229] = 191, - [4] = 1, - [25] = -1, - [190] = 58, - [264] = 227, + [352] = 315, + [161] = 148, + [423] = -1, // ia32 only: sched_rr_get_interval_time64 + [140] = -1, // ia32 only: _llseek + [142] = -1, // ia32 only: _newselect };