[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AddressSanitizer: heap-buffer-overflow in rl_tilde_expand
From: |
Chet Ramey |
Subject: |
Re: AddressSanitizer: heap-buffer-overflow in rl_tilde_expand |
Date: |
Fri, 16 Jun 2017 12:10:26 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 |
On 6/16/17 10:43 AM, Eduardo A. Bustamante López wrote:
> On Thu, Jun 15, 2017 at 09:39:09AM -0500, Eduardo Bustamante wrote:
>> Found by fuzzing `read -e' with AFL. The stacktrace reported by Address
>> Sanitizer is followed by the base64 encoded crashing input.
>>
>>
>> ==472==ERROR: AddressSanitizer: heap-buffer-overflow on address
>> 0x61100000977f at pc 0x562befba4a14 bp 0x7ffdee172bb0 sp 0x7ffdee172ba8
>> READ of size 1 at 0x61100000977f thread T0
>> #0 0x562befba4a13 in rl_tilde_expand
>> (/home/dualbus/src/gnu/bash-build/bash+0x23ba13)
>
> This one looks like an easy fix. When `start = 0', the loop ends up
> dereferencing `rl_line_buffer[-1]'. Changing the order of the test does the
> trick.
This is indeed the right fix.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/