Commit f10d059
bpf: Make BPF_PROG_RUN_ARRAY return -err instead of allow boolean
Right now BPF_PROG_RUN_ARRAY and related macros return 1 or 0
for whether the prog array allows or rejects whatever is being
hooked. The caller of these macros then return -EPERM or continue
processing based on thw macro's return value. Unforunately this is
inflexible, since -EPERM is the only err that can be returned.
This patch should be a no-op; it prepares for the next patch. The
returning of the -EPERM is moved to inside the macros, so the outer
functions are directly returning what the macros returned if they
are non-zero.
Signed-off-by: YiFei Zhu <zhuyifei@google.com>
Reviewed-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/788abcdca55886d1f43274c918eaa9f792a9f33b.1639619851.git.zhuyifei@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>1 parent d81283d commit f10d059
File tree
3 files changed
+25
-34
lines changed- include/linux
- kernel/bpf
- security
3 files changed
+25
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1277 | 1277 | | |
1278 | 1278 | | |
1279 | 1279 | | |
1280 | | - | |
| 1280 | + | |
1281 | 1281 | | |
1282 | 1282 | | |
1283 | 1283 | | |
| |||
1287 | 1287 | | |
1288 | 1288 | | |
1289 | 1289 | | |
1290 | | - | |
| 1290 | + | |
1291 | 1291 | | |
1292 | 1292 | | |
1293 | 1293 | | |
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
1301 | | - | |
| 1301 | + | |
| 1302 | + | |
1302 | 1303 | | |
1303 | 1304 | | |
1304 | 1305 | | |
| |||
1308 | 1309 | | |
1309 | 1310 | | |
1310 | 1311 | | |
1311 | | - | |
| 1312 | + | |
1312 | 1313 | | |
1313 | 1314 | | |
1314 | 1315 | | |
| |||
1317 | 1318 | | |
1318 | 1319 | | |
1319 | 1320 | | |
1320 | | - | |
| 1321 | + | |
1321 | 1322 | | |
1322 | 1323 | | |
1323 | 1324 | | |
| |||
1326 | 1327 | | |
1327 | 1328 | | |
1328 | 1329 | | |
1329 | | - | |
| 1330 | + | |
| 1331 | + | |
1330 | 1332 | | |
1331 | 1333 | | |
1332 | 1334 | | |
| |||
1394 | 1396 | | |
1395 | 1397 | | |
1396 | 1398 | | |
1397 | | - | |
| 1399 | + | |
1398 | 1400 | | |
1399 | 1401 | | |
1400 | 1402 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1080 | 1080 | | |
1081 | 1081 | | |
1082 | 1082 | | |
1083 | | - | |
1084 | 1083 | | |
1085 | 1084 | | |
1086 | 1085 | | |
| |||
1107 | 1106 | | |
1108 | 1107 | | |
1109 | 1108 | | |
1110 | | - | |
1111 | 1109 | | |
1112 | | - | |
1113 | | - | |
| 1110 | + | |
| 1111 | + | |
1114 | 1112 | | |
1115 | 1113 | | |
1116 | 1114 | | |
| |||
1142 | 1140 | | |
1143 | 1141 | | |
1144 | 1142 | | |
1145 | | - | |
1146 | 1143 | | |
1147 | 1144 | | |
1148 | 1145 | | |
| |||
1156 | 1153 | | |
1157 | 1154 | | |
1158 | 1155 | | |
1159 | | - | |
1160 | | - | |
1161 | | - | |
1162 | | - | |
| 1156 | + | |
| 1157 | + | |
1163 | 1158 | | |
1164 | 1159 | | |
1165 | 1160 | | |
| |||
1184 | 1179 | | |
1185 | 1180 | | |
1186 | 1181 | | |
1187 | | - | |
1188 | 1182 | | |
1189 | | - | |
1190 | | - | |
1191 | | - | |
| 1183 | + | |
| 1184 | + | |
1192 | 1185 | | |
1193 | 1186 | | |
1194 | 1187 | | |
| |||
1201 | 1194 | | |
1202 | 1195 | | |
1203 | 1196 | | |
1204 | | - | |
| 1197 | + | |
1205 | 1198 | | |
1206 | 1199 | | |
1207 | 1200 | | |
1208 | | - | |
1209 | | - | |
| 1201 | + | |
| 1202 | + | |
1210 | 1203 | | |
1211 | 1204 | | |
1212 | | - | |
| 1205 | + | |
1213 | 1206 | | |
1214 | 1207 | | |
1215 | 1208 | | |
| |||
1350 | 1343 | | |
1351 | 1344 | | |
1352 | 1345 | | |
1353 | | - | |
| 1346 | + | |
1354 | 1347 | | |
1355 | 1348 | | |
1356 | 1349 | | |
| |||
1455 | 1448 | | |
1456 | 1449 | | |
1457 | 1450 | | |
1458 | | - | |
1459 | | - | |
| 1451 | + | |
1460 | 1452 | | |
1461 | | - | |
1462 | 1453 | | |
1463 | 1454 | | |
1464 | 1455 | | |
| |||
1565 | 1556 | | |
1566 | 1557 | | |
1567 | 1558 | | |
1568 | | - | |
1569 | | - | |
| 1559 | + | |
1570 | 1560 | | |
1571 | | - | |
1572 | 1561 | | |
1573 | 1562 | | |
1574 | 1563 | | |
| |||
1624 | 1613 | | |
1625 | 1614 | | |
1626 | 1615 | | |
1627 | | - | |
1628 | | - | |
| 1616 | + | |
| 1617 | + | |
1629 | 1618 | | |
1630 | 1619 | | |
1631 | 1620 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
838 | 838 | | |
839 | 839 | | |
840 | 840 | | |
841 | | - | |
| 841 | + | |
842 | 842 | | |
843 | 843 | | |
844 | 844 | | |
| |||
0 commit comments