Alexey Khoroshilov
19eeb2f9e7
farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()
...
There are several issues in fst_add_one() and fst_init_card():
- invalid pointer dereference at card->ports[card->nports - 1] if
register_hdlc_device() fails for the first port in fst_init_card();
- fst_card_array overflow at fst_card_array[no_of_cards_added]
because there is no checks for array overflow;
- use after free because pointer to deallocated card is left in fst_card_array
if something fails after fst_card_array[no_of_cards_added] = card;
- several leaks on failure paths in fst_add_one().
The patch fixes all the issues and makes code more readable.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru >
Signed-off-by: David S. Miller <davem@davemloft.net >
2014-07-11 13:34:48 -07:00
..
2014-06-19 14:40:48 +02:00
2014-06-09 14:58:36 -07:00
2014-06-02 17:11:03 -07:00
2014-06-23 16:47:44 -07:00
2014-06-23 12:55:37 +04:00
2014-06-23 18:22:48 +02:00
2014-06-17 17:09:35 +02:00
2014-06-11 08:41:17 -07:00
2014-06-17 14:23:14 -10:00
2014-06-15 16:02:20 -10:00
2014-06-17 00:23:29 +09:00
2014-06-03 08:06:56 -07:00
2014-06-18 21:52:20 +02:00
2014-06-18 21:54:46 +02:00
2014-06-11 17:03:19 +10:00
2014-05-24 22:33:51 +09:00
2014-06-10 10:28:45 -07:00
2014-06-02 12:15:19 -07:00
2014-06-04 09:08:25 -07:00
2014-06-05 13:15:32 -07:00
2014-06-12 09:57:00 +02:00
2014-06-19 18:49:37 -10:00
2014-06-11 16:09:14 -07:00
2014-06-05 00:59:05 +02:00
2014-06-12 14:27:40 -07:00
2014-06-25 15:16:09 -07:00
2014-06-17 14:28:04 +02:00
2014-06-18 10:41:08 -07:00
2014-06-12 22:38:32 -07:00
2014-06-09 18:46:02 -07:00
2014-06-06 11:48:46 -07:00
2014-06-04 15:59:13 -07:00
2014-07-08 16:06:21 -07:00
2014-06-12 13:08:09 -07:00
2014-06-24 12:43:15 +10:00
2014-05-27 17:38:11 -07:00
2014-06-12 13:33:29 -07:00
2014-06-12 23:04:28 -07:00
2014-06-23 16:47:44 -07:00
2014-05-28 18:14:16 +02:00
2014-06-12 12:42:32 -07:00
2014-06-25 12:19:01 -07:00
2014-06-12 14:27:40 -07:00
2014-06-12 10:30:18 -07:00
2014-07-11 13:34:48 -07:00
2014-05-26 01:28:28 +02:00
2014-06-04 16:54:17 -07:00
2014-07-02 00:24:14 -07:00
2014-06-06 16:08:15 -07:00
2014-06-12 13:20:24 -07:00
2014-05-27 14:58:24 -06:00
2014-06-03 11:20:32 -07:00
2014-06-10 16:58:32 -07:00
2014-06-03 23:13:00 +02:00
2014-06-04 08:57:16 -07:00
2014-06-17 15:43:48 -07:00
2014-06-11 14:06:55 -07:00
2014-06-06 16:08:13 -07:00
2014-06-16 16:05:57 +01:00
2014-06-17 17:09:36 +02:00
2014-06-02 16:35:49 -07:00
2014-06-20 08:22:39 +08:00
2014-06-21 06:47:01 -10:00
2014-06-20 08:22:39 +08:00
2014-06-06 11:44:09 -07:00
2014-05-26 21:27:09 +02:00
2014-06-06 10:52:46 +01:00
2014-06-19 17:33:37 -07:00
2014-06-12 22:38:32 -07:00
2014-06-11 14:26:21 -07:00
2014-06-25 12:19:01 -07:00
2014-06-17 16:07:08 -07:00
2014-06-17 17:05:50 -07:00
2014-05-27 15:18:48 -07:00
2014-06-07 20:12:15 -07:00
2014-06-23 09:22:48 +03:00
2014-06-19 18:40:36 -10:00
2014-06-19 17:51:46 -07:00
2014-06-21 06:47:01 -10:00
2014-06-19 07:53:27 -10:00
2014-05-23 11:37:46 -05:00
2014-06-03 08:06:56 -07:00