All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	cotte@de.ibm.com, npiggin@suse.de, jaredeh@gmail.com
Subject: Re: [PATCH] do_xip_mapping_read: fix length calculation
Date: Wed, 1 Apr 2009 14:17:00 -0700	[thread overview]
Message-ID: <20090401141700.f5ef3c08.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090331153223.74b177bd@skybase>

On Tue, 31 Mar 2009 15:32:23 +0200
Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:

> From: Martin Schwidefsky <schwidefsky@de.ibm.com>
> 
> The calculation of the value nr in do_xip_mapping_read is incorrect. If
> the copy required more than one iteration in the do while loop the
> copies variable will be non-zero. The maximum length that may be passed
> to the call to copy_to_user(buf+copied, xip_mem+offset, nr) is len-copied
> but the check only compares against (nr > len).
> 
> This bug is the cause for the heap corruption Carsten has been chasing
> for so long:
> 
> *** glibc detected *** /bin/bash: free(): invalid next size (normal): 0x00000000800e39f0 ***  
> ======= Backtrace: =========  
> /lib64/libc.so.6[0x200000b9b44]  
> /lib64/libc.so.6(cfree+0x8e)[0x200000bdade]  
> /bin/bash(free_buffered_stream+0x32)[0x80050e4e]  
> /bin/bash(close_buffered_stream+0x1c)[0x80050ea4]  
> /bin/bash(unset_bash_input+0x2a)[0x8001c366]  
> /bin/bash(make_child+0x1d4)[0x8004115c]  
> /bin/bash[0x8002fc3c]  
> /bin/bash(execute_command_internal+0x656)[0x8003048e]  
> /bin/bash(execute_command+0x5e)[0x80031e1e]  
> /bin/bash(execute_command_internal+0x79a)[0x800305d2]  
> /bin/bash(execute_command+0x5e)[0x80031e1e]  
> /bin/bash(reader_loop+0x270)[0x8001efe0]  
> /bin/bash(main+0x1328)[0x8001e960]  
> /lib64/libc.so.6(__libc_start_main+0x100)[0x200000592a8]  
> /bin/bash(clearerr+0x5e)[0x8001c092]  

Please get into the habit of adding Cc: <stable@kernel.org> to the
changelogs?

I believe I personally am pretty good at picking up stable things, but
other patch-mergers are quite unreliable.  We all need as much help as
we can get on this, because things are falling through cracks.

> With this bug fix the commit 0e4a9b59282914fe057ab17027f55123964bc2e2
> "ext2/xip: refuse to change xip flag during remount with busy inodes"
> can be removed again.

OK, please send a standalone patch to do this at an appropriate time. 
I guess that this second patch won't be needed in -stable.


WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	cotte@de.ibm.com, npiggin@suse.de, jaredeh@gmail.com
Subject: Re: [PATCH] do_xip_mapping_read: fix length calculation
Date: Wed, 1 Apr 2009 14:17:00 -0700	[thread overview]
Message-ID: <20090401141700.f5ef3c08.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090331153223.74b177bd@skybase>

On Tue, 31 Mar 2009 15:32:23 +0200
Martin Schwidefsky <schwidefsky@de.ibm.com> wrote:

> From: Martin Schwidefsky <schwidefsky@de.ibm.com>
> 
> The calculation of the value nr in do_xip_mapping_read is incorrect. If
> the copy required more than one iteration in the do while loop the
> copies variable will be non-zero. The maximum length that may be passed
> to the call to copy_to_user(buf+copied, xip_mem+offset, nr) is len-copied
> but the check only compares against (nr > len).
> 
> This bug is the cause for the heap corruption Carsten has been chasing
> for so long:
> 
> *** glibc detected *** /bin/bash: free(): invalid next size (normal): 0x00000000800e39f0 ***  
> ======= Backtrace: =========  
> /lib64/libc.so.6[0x200000b9b44]  
> /lib64/libc.so.6(cfree+0x8e)[0x200000bdade]  
> /bin/bash(free_buffered_stream+0x32)[0x80050e4e]  
> /bin/bash(close_buffered_stream+0x1c)[0x80050ea4]  
> /bin/bash(unset_bash_input+0x2a)[0x8001c366]  
> /bin/bash(make_child+0x1d4)[0x8004115c]  
> /bin/bash[0x8002fc3c]  
> /bin/bash(execute_command_internal+0x656)[0x8003048e]  
> /bin/bash(execute_command+0x5e)[0x80031e1e]  
> /bin/bash(execute_command_internal+0x79a)[0x800305d2]  
> /bin/bash(execute_command+0x5e)[0x80031e1e]  
> /bin/bash(reader_loop+0x270)[0x8001efe0]  
> /bin/bash(main+0x1328)[0x8001e960]  
> /lib64/libc.so.6(__libc_start_main+0x100)[0x200000592a8]  
> /bin/bash(clearerr+0x5e)[0x8001c092]  

Please get into the habit of adding Cc: <stable@kernel.org> to the
changelogs?

I believe I personally am pretty good at picking up stable things, but
other patch-mergers are quite unreliable.  We all need as much help as
we can get on this, because things are falling through cracks.

> With this bug fix the commit 0e4a9b59282914fe057ab17027f55123964bc2e2
> "ext2/xip: refuse to change xip flag during remount with busy inodes"
> can be removed again.

OK, please send a standalone patch to do this at an appropriate time. 
I guess that this second patch won't be needed in -stable.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2009-04-01 21:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 13:32 [PATCH] do_xip_mapping_read: fix length calculation Martin Schwidefsky
2009-03-31 13:32 ` Martin Schwidefsky
2009-04-01 21:17 ` Andrew Morton [this message]
2009-04-01 21:17   ` Andrew Morton
2009-04-02  7:38   ` Martin Schwidefsky
2009-04-02  7:38     ` Martin Schwidefsky
2009-04-03 20:53 ` Jared Hulbert
2009-04-03 20:53   ` Jared Hulbert
2009-04-04  0:35 ` Minchan Kim
2009-04-04  0:35   ` Minchan Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090401141700.f5ef3c08.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cotte@de.ibm.com \
    --cc=jaredeh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.