Re: [PATCH RESEND] 8250_pci: Fix potential use-after-free in error path

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/28/2016 04:04 PM, Fabio Estevam wrote:
> Hi Guilherme,
> 
> On Wed, Dec 28, 2016 at 3:58 PM, Guilherme G. Piccoli
> <gpiccoli@xxxxxxxxxxxxxxxxxx> wrote:
>> From: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxxxxx>
>>
>> Commit f209fa03fc9d ("serial: 8250_pci: Detach low-level driver during
>> PCI error recovery") introduces a potential use-after-free in case the
>> pciserial_init_ports call in serial8250_io_resume fails, which may
>> happen if a memory allocation fails or if the .init quirk failed for
>> whatever reason).  If this happen, further pci_get_drvdata will return a
>> pointer to freed memory.
>>
>> This patch reworks the PCI recovery resume hook to restore the old priv
>> structure in this case, which should be ok, since the ports were already
>> detached. Such error during recovery causes us to give up on the
>> recovery.
>>
>> Fixes: f209fa03fc9d ("serial: 8250_pci: Detach low-level driver during
>>   PCI error recovery")
>> Reported-by: Michal Suchanek <msuchanek@xxxxxxxx>
>> Signed-off-by: Gabriel Krisman Bertazi <krisman@xxxxxxxxxxxxxxxxxx>
> 
> Your Signed-off-by is missing here.
> 

Thanks Fabio! Already sent a V2.

Cheers,



Guilherme

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux