Commit 4db3d75
nvmet: Don't overflow subsysnqn
nvmet_root_discovery_nqn_store treats the subsysnqn string like a fixed
size buffer, even though it is dynamically allocated to the size of the
string.
Create a new string with kstrndup instead of using the old buffer.
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=ff4aab278fa7e27e0f9e
Fixes: 95409e2 ("nvmet: implement unique discovery NQN")
Signed-off-by: Leo Stone <[email protected]>
Reviewed-by: Sagi Grimberg <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Keith Busch <[email protected]>1 parent ebefac5 commit 4db3d75
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2254 | 2254 | | |
2255 | 2255 | | |
2256 | 2256 | | |
| 2257 | + | |
2257 | 2258 | | |
2258 | 2259 | | |
2259 | 2260 | | |
2260 | 2261 | | |
2261 | 2262 | | |
2262 | 2263 | | |
| 2264 | + | |
| 2265 | + | |
| 2266 | + | |
| 2267 | + | |
2263 | 2268 | | |
2264 | 2269 | | |
2265 | 2270 | | |
| |||
2268 | 2273 | | |
2269 | 2274 | | |
2270 | 2275 | | |
| 2276 | + | |
2271 | 2277 | | |
2272 | 2278 | | |
2273 | 2279 | | |
2274 | | - | |
2275 | | - | |
| 2280 | + | |
| 2281 | + | |
2276 | 2282 | | |
2277 | 2283 | | |
| 2284 | + | |
2278 | 2285 | | |
2279 | 2286 | | |
2280 | 2287 | | |
| |||
0 commit comments