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: <CAErMHp9BBaJ8iNyjOS3nU+LUWNijL6FSOKSmVAYY_20nfB9nAQ@mail.gmail.com>
Date:   Wed, 6 Dec 2017 18:45:13 +0900
From:   Jinbum Park <jinb.park7@...il.com>
To:     Kees Cook <keescook@...omium.org>
Cc:     linux-arm-kernel@...ts.infradead.org,
        LKML <linux-kernel@...r.kernel.org>,
        kernel-hardening@...ts.openwall.com,
        Afzal Mohammed <afzal.mohd.ma@...il.com>,
        Mark Rutland <mark.rutland@....com>,
        Laura Abbott <labbott@...hat.com>,
        Russell King <linux@...linux.org.uk>,
        Greg KH <gregkh@...uxfoundation.org>,
        Vladimir Murzin <vladimir.murzin@....com>,
        Arnd Bergmann <arnd@...db.de>
Subject: Re: [kernel-hardening][PATCH v3 1/3] arm: mm: dump: make page table
 dumping reusable

>> +#ifndef __ASM_PTDUMP_H
>> +#define __ASM_PTDUMP_H
>> +
>> +#ifdef CONFIG_ARM_PTDUMP_CORE
>
> Is this #ifdef needed? I think this file is only included in dump.c
> and ptdump_debugfs.c, both of which are only built when
> CONFIG_ARM_PTDUMP_CORE is defined.

Looking at next patch in this patch-set series ([PATCH v3 3/3] arm:
mm: dump: add checking for writable and executable pages),
Not only dump.c and ptdump_debugfs.c but also arch/arm/mm/init.c
include this file (ptdump.h) to call debug_checkwx().
mm/init.c is not built only when CONFIG_ARM_PTDUMP_CORE is defined.
So, This #ifdef seems not be needed for this patch, but is needed for
this patch-set series.


>> +static int ptdump_init(void)
>> +{
>> +       ptdump_initialize();
>> +       return ptdump_debugfs_register(&kernel_ptdump_info,
>> +                                       "kernel_page_tables");
>
> This changes the return value of ptdump_init. This should do similar
> to what was done before:
>
> return ptdump_debugfs_register(&kernel_ptdump_info,
> "kernel_page_tables") ? 0 : -ENOMEM;


ptdump_debugfs_register() already returns what you think.

>> +int ptdump_debugfs_register(struct ptdump_info *info, const char *name)
>> +{
>> +       struct dentry *pe;
>> +
>> +       pe = debugfs_create_file(name, 0400, NULL, info, &ptdump_fops);
>> +       return pe ? 0 : -ENOMEM;
>> +
>> +}

So "return ptdump_debugfs_register(~~)" is fine.


Thanks.
Jinbum Park.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ