Daniel Wagner
85428beac8
nvmet: seset ns->file when open fails
...
Reset the ns->file value to NULL also in the error case in
nvmet_file_ns_enable().
The ns->file variable points either to file object or contains the
error code after the filp_open() call. This can lead to following
problem:
When the user first setups an invalid file backend and tries to enable
the ns, it will fail. Then the user switches over to a bdev backend
and enables successfully the ns. The first received I/O will crash the
system because the IO backend is chosen based on the ns->file value:
static u16 nvmet_parse_io_cmd(struct nvmet_req *req)
{
[...]
if (req->ns->file)
return nvmet_file_parse_io_cmd(req);
return nvmet_bdev_parse_io_cmd(req);
}
Reported-by: Enzo Matsumiya <ematsumiya@suse.com >
Signed-off-by: Daniel Wagner <dwagner@suse.de >
Signed-off-by: Christoph Hellwig <hch@lst.de >
2021-05-12 19:48:48 +02:00
..
2021-04-26 11:20:10 -07:00
2021-04-27 10:16:46 -07:00
2021-04-27 13:42:11 -07:00
2021-04-28 17:22:10 -07:00
2021-04-26 09:43:16 -07:00
2021-04-26 16:21:16 -07:00
2021-05-03 11:00:11 -06:00
2021-04-26 11:20:10 -07:00
2021-04-26 12:11:52 -07:00
2021-04-11 19:32:06 -06:00
2021-04-28 15:54:57 -07:00
2021-04-28 17:13:56 -07:00
2021-04-26 12:30:36 -07:00
2021-04-15 09:26:25 +02:00
2021-04-26 15:10:25 -07:00
2021-04-08 20:05:49 +02:00
2021-04-26 08:51:23 -07:00
2021-04-16 18:21:56 -07:00
2021-04-08 13:14:51 +09:00
2021-04-26 12:11:52 -07:00
2021-04-08 12:21:13 +02:00
2021-04-28 15:59:13 -07:00
2021-04-26 09:43:16 -07:00
2021-04-29 11:28:08 -07:00
2021-04-26 12:11:52 -07:00
2021-04-28 15:59:13 -07:00
2021-04-28 17:19:47 -07:00
2021-04-16 07:26:50 +02:00
2021-04-16 00:14:49 +02:00
2021-04-27 18:09:44 -07:00
2021-04-26 15:03:23 -07:00
2021-04-16 09:34:57 +02:00
2021-04-28 15:59:13 -07:00
2021-04-08 19:18:07 +02:00
2021-04-26 16:32:11 -07:00
2021-05-03 11:00:11 -06:00
2021-04-28 15:59:13 -07:00
2021-04-27 10:16:46 -07:00
2021-04-29 11:28:08 -07:00
2021-04-09 14:54:23 -07:00
2021-04-13 09:16:12 -06:00
2021-04-28 16:10:33 -07:00
2021-04-28 14:39:37 -07:00
2021-04-28 10:01:40 -07:00
2021-04-26 15:10:25 -07:00
2021-04-26 11:08:23 +02:00
2021-04-13 01:39:12 -04:00
2021-04-28 15:59:13 -07:00
2021-04-27 10:16:46 -07:00
2021-04-28 15:56:51 -07:00
2021-04-26 11:14:21 -07:00
2021-04-27 18:09:44 -07:00
2021-04-28 12:37:53 -07:00
2021-04-09 21:56:01 -07:00
2021-05-12 19:48:48 +02:00
2021-04-28 15:50:24 -07:00
2021-04-27 17:54:15 -07:00
2021-04-16 07:27:37 +02:00
2021-04-26 12:11:52 -07:00
2021-04-26 11:32:23 -07:00
2021-04-28 15:43:58 -07:00
2021-04-26 11:20:10 -07:00
2021-04-28 15:59:13 -07:00
2021-04-28 15:59:13 -07:00
2021-04-08 17:38:20 +02:00
2021-04-28 15:59:13 -07:00
2021-05-03 11:00:11 -06:00
2021-04-28 17:22:10 -07:00
2021-04-26 09:43:16 -07:00
2021-04-26 12:11:52 -07:00
2021-04-27 10:16:46 -07:00
2021-04-28 17:13:56 -07:00
2021-04-28 17:22:10 -07:00
2021-04-26 12:11:52 -07:00
2021-04-13 12:17:14 +02:00
2021-04-26 15:10:25 -07:00
2021-04-28 17:22:10 -07:00
2021-04-22 18:15:31 -04:00
2021-04-28 17:19:47 -07:00
2021-04-28 17:22:10 -07:00
2021-04-28 16:02:58 -07:00
2021-04-10 10:58:21 +02:00
2021-04-28 15:59:13 -07:00
2021-04-28 17:22:10 -07:00
2021-04-15 09:26:25 +02:00
2021-04-15 09:26:25 +02:00