Commit 80bdfbb
ublk: enforce ublks_max only for unprivileged devices
Commit 403ebc8 ("ublk_drv: add module parameter of ublks_max for
limiting max allowed ublk dev"), claimed ublks_max was added to prevent
a DoS situation with an untrusted user creating too many ublk devices.
If that's the case, ublks_max should only restrict the number of
unprivileged ublk devices in the system. Enforce the limit only for
unprivileged ublk devices, and rename variables accordingly. Leave the
external-facing parameter name unchanged, since changing it may break
systems which use it (but still update its documentation to reflect its
new meaning).
As a result of this change, in a system where there are only normal
(non-unprivileged) devices, the maximum number of such devices is
increased to 1 << MINORBITS, or 1048576. That ought to be enough for
anyone, right?
Signed-off-by: Uday Shankar <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent 3aab938 commit 80bdfbb
1 file changed
+27
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
493 | 496 | | |
494 | | - | |
| 497 | + | |
495 | 498 | | |
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
499 | | - | |
500 | | - | |
501 | | - | |
| 502 | + | |
| 503 | + | |
502 | 504 | | |
503 | 505 | | |
504 | 506 | | |
| |||
2203 | 2205 | | |
2204 | 2206 | | |
2205 | 2207 | | |
2206 | | - | |
| 2208 | + | |
| 2209 | + | |
2207 | 2210 | | |
2208 | 2211 | | |
2209 | 2212 | | |
| |||
2232 | 2235 | | |
2233 | 2236 | | |
2234 | 2237 | | |
| 2238 | + | |
| 2239 | + | |
2235 | 2240 | | |
2236 | 2241 | | |
2237 | 2242 | | |
| 2243 | + | |
2238 | 2244 | | |
2239 | | - | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
2240 | 2248 | | |
2241 | 2249 | | |
2242 | 2250 | | |
| |||
2501 | 2509 | | |
2502 | 2510 | | |
2503 | 2511 | | |
2504 | | - | |
| 2512 | + | |
| 2513 | + | |
2505 | 2514 | | |
2506 | 2515 | | |
2507 | 2516 | | |
| |||
3138 | 3147 | | |
3139 | 3148 | | |
3140 | 3149 | | |
3141 | | - | |
| 3150 | + | |
| 3151 | + | |
3142 | 3152 | | |
3143 | 3153 | | |
3144 | 3154 | | |
3145 | 3155 | | |
3146 | | - | |
| 3156 | + | |
| 3157 | + | |
3147 | 3158 | | |
3148 | | - | |
| 3159 | + | |
3149 | 3160 | | |
3150 | 3161 | | |
3151 | | - | |
3152 | | - | |
3153 | | - | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
3154 | 3165 | | |
3155 | 3166 | | |
3156 | | - | |
3157 | | - | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
3158 | 3170 | | |
3159 | 3171 | | |
3160 | 3172 | | |
| |||
0 commit comments