Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 597006 - app-shells/bash-4.4: large HISTFILESIZE value may result in upfront memory exhaustion
Summary: app-shells/bash-4.4: large HISTFILESIZE value may result in upfront memory ex...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://lists.gnu.org/archive/html/bug...
Whiteboard:
Keywords:
Depends on:
Blocks: bash-4.4
  Show dependency tree
 
Reported: 2016-10-13 01:35 UTC by kfm
Modified: 2022-08-27 18:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to clamp the amount of memory initially allocated for history (bash-4.4-histfilesize-alloc.patch,842 bytes, patch)
2016-10-13 01:39 UTC, kfm
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kfm 2016-10-13 01:35:25 UTC
As of 4.4, bash tries to allocate enough memory to cover as many entries as are specified by HISTFILESIZE. Some people set this to an arbitrarily large value, in which case potentially dire results will ensue after upgrading to 4.4. Here's a patch from Chet Ramey:

http://lists.gnu.org/archive/html/bug-bash/2016-10/msg00010.html

A plausible worst-case scenario would be that someone upgrades a remote system, only to find that they can no longer log in with ssh. Therefore, I recommend applying said patch by way of a revision bump. Presumably, it will be addressed in bash44-001, whenever that lands.
Comment 1 kfm 2016-10-13 01:39:04 UTC
Created attachment 450060 [details, diff]
Patch to clamp the amount of memory initially allocated for history
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-10-13 08:37:14 UTC
commit eb4d79382613c3fa33a2375ba75f3b4f8b67eae4
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Thu Oct 13 10:29:59 2016

    app-shells/bash: Revbump to fix bug #597006

    Package-Manager: portage-2.3.2
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

Fixed in app-shells/bash-4.4-r1
Comment 3 SpanKY gentoo-dev 2016-11-10 06:03:19 UTC
that patch is against readline, and released versions of bash don't build against the bundled copy, so putting the patch into bash doesn't help :)

fixed here:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4b0bd0d1d7636f79c4c1a65ab280c7f9009ff26e
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a6d6915dfc68f4a67a7e8c03265d9e02ed39425
Comment 4 kfm 2016-11-10 13:59:01 UTC
(In reply to SpanKY from comment #3)
> that patch is against readline, and released versions of bash don't build
> against the bundled copy, so putting the patch into bash doesn't help :)

I'm embarrassed to have overlooked that. Thanks, SpanKY.