Re: [PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()

2014-07-08 Thread David Miller
From: Alexey Khoroshilov Date: Tue, 08 Jul 2014 18:40:32 -0400 > On 08.07.2014 18:20, David Miller wrote: >> From: Alexey Khoroshilov >> Date: Sat, 5 Jul 2014 03:35:50 +0400 >> >>> -} >>> + card->nports = i; >>> + return (card->nports == 0) ?

Re: [PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()

2014-07-08 Thread Alexey Khoroshilov
On 08.07.2014 18:20, David Miller wrote: > From: Alexey Khoroshilov > Date: Sat, 5 Jul 2014 03:35:50 +0400 > >> -} >> +card->nports = i; >> +return (card->nports == 0) ? err : 0; >> +} > I don't think this is the right thing to d

Re: [PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()

2014-07-08 Thread David Miller
From: Alexey Khoroshilov Date: Sat, 5 Jul 2014 03:35:50 +0400 > -} > + card->nports = i; > + return (card->nports == 0) ? err : 0; > + } I don't think this is the right thing to do. This will cause the caller to not free the I

[PATCH] farsync: fix invalid memory accesses in fst_add_one() and fst_init_card()

2014-07-04 Thread Alexey Khoroshilov
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 arra