Commit 9286675
Benjamin Tissoires
HID: bpf: add HID-BPF hooks for hid_hw_output_report
Same story than hid_hw_raw_requests:
This allows to intercept and prevent or change the behavior of
hid_hw_output_report() from a bpf program.
The intent is to solve a couple of use case:
- firewalling a HID device: a firewall can monitor who opens the hidraw
nodes and then prevent or allow access to write operations on that
hidraw node.
- change the behavior of a device and emulate a new HID feature request
The hook is allowed to be run as sleepable so it can itself call
hid_hw_output_report(), which allows to "convert" one feature request into
another or even call the feature request on a different HID device on the
same physical device.
Link: https://patch.msgid.link/[email protected]
Acked-by: Jiri Kosina <[email protected]>
Signed-off-by: Benjamin Tissoires <[email protected]>1 parent 015a4a2 commit 9286675
File tree
6 files changed
+70
-9
lines changed- drivers/hid
- bpf
- include/linux
6 files changed
+70
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
116 | 150 | | |
117 | 151 | | |
118 | 152 | | |
| |||
443 | 477 | | |
444 | 478 | | |
445 | 479 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 480 | + | |
450 | 481 | | |
451 | 482 | | |
452 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2445 | 2445 | | |
2446 | 2446 | | |
2447 | 2447 | | |
2448 | | - | |
| 2448 | + | |
| 2449 | + | |
2449 | 2450 | | |
2450 | 2451 | | |
| 2452 | + | |
2451 | 2453 | | |
2452 | 2454 | | |
2453 | 2455 | | |
2454 | 2456 | | |
2455 | 2457 | | |
2456 | 2458 | | |
2457 | 2459 | | |
| 2460 | + | |
| 2461 | + | |
| 2462 | + | |
| 2463 | + | |
2458 | 2464 | | |
2459 | 2465 | | |
2460 | 2466 | | |
| |||
2472 | 2478 | | |
2473 | 2479 | | |
2474 | 2480 | | |
2475 | | - | |
| 2481 | + | |
2476 | 2482 | | |
2477 | 2483 | | |
2478 | 2484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1130 | 1130 | | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | | - | |
| 1133 | + | |
| 1134 | + | |
1134 | 1135 | | |
1135 | 1136 | | |
1136 | 1137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
157 | 175 | | |
158 | 176 | | |
159 | 177 | | |
| |||
182 | 200 | | |
183 | 201 | | |
184 | 202 | | |
| 203 | + | |
| 204 | + | |
185 | 205 | | |
186 | 206 | | |
187 | 207 | | |
| |||
196 | 216 | | |
197 | 217 | | |
198 | 218 | | |
| 219 | + | |
| 220 | + | |
199 | 221 | | |
200 | 222 | | |
201 | 223 | | |
| |||
0 commit comments