lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACVxJT8q5ZH-hXAJPozB+kJ5khYqHLugVT3i2020f4nVyGaPUw@mail.gmail.com>
Date:	Wed, 27 May 2015 14:08:58 +0300
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	Jan Stancek <jstancek@...hat.com>
Cc:	Jarod Wilson <jwilson@...hat.com>, Jarod Wilson <jarod@...hat.com>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH try #4] proc: fix PAGE_SIZE limit of /proc/$PID/cmdline

On Wed, May 27, 2015 at 1:56 PM, Jan Stancek <jstancek@...hat.com> wrote:
> On Wed, May 27, 2015 at 01:27:13AM -0400, Jarod Wilson wrote:
>> On May 26, 2015, at 5:24 PM, Alexey Dobriyan <adobriyan@...il.com> wrote:
>> >> Should have tested on more than just x86, it appears. We've started
>> >> hammering on this internally across all arches, and its exploded
>> >> multiple times on ppc64 now:
>> >>
>> >> [ 2717.074699] ------------[ cut here ]------------
>> >> [ 2717.074787] kernel BUG at fs/proc/base.c:244!
>> >
>> >> OE--------------   3.10.0-255.el7.ppc64.debug #1
>> >
>> > Which BUG_ON is this?
>> >
>> >    BUG_ON(*pos < 0);
>> >    BUG_ON(arg_start > arg_end);
>> >    BUG_ON(env_start > env_end);
>>
>
> Is create_elf_tables() taking mm->mmap_sem when it's initialising env_start/end?
>
> I could reproduce it on x86_64 as well, just by doing exec in loop
> and "ps afx" in other window:

OK.

I've reproduced BUG_ON by running this program which sets arg_start>arg_end:

#include <sys/mman.h>
#include <sys/prctl.h>
#include <unistd.h>

enum {PAGE_SIZE=4096};

int main(void)
{
        unsigned long env_start, env_end;
        void *p;

        p = mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0);

#define PR_SET_MM               35
#define PR_SET_MM_ARG_START     8
#define PR_SET_MM_ARG_END       9
#define PR_SET_MM_ENV_START     10
#define PR_SET_MM_ENV_END       11
        prctl(PR_SET_MM, PR_SET_MM_ARG_START, (unsigned long)p +
PAGE_SIZE - 1, 0, 0);
        prctl(PR_SET_MM, PR_SET_MM_ARG_END,   (unsigned long)p, 0, 0);

        pause();
        return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ