Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1318343
| Path | csiph.com!news.mixmin.net!weretis.net!feeder4.news.weretis.net!storethat.news.telefonica.de!telefonica.de!news.panservice.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Laura Abbott <labbott@redhat.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option |
| Date | Tue, 26 Jan 2016 21:30:03 +0100 |
| Message-ID | <qVipt-Vs-27@gated-at.bofh.it> (permalink) |
| References | <qUSEG-6QD-11@gated-at.bofh.it> <qUSEJ-6QD-75@gated-at.bofh.it> <qV5BT-8fo-11@gated-at.bofh.it> |
| X-Original-To | Jianyu Zhan <nasa4836@gmail.com>, Laura Abbott <labbott@fedoraproject.org> |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Scanned-By | MIMEDefang 2.68 on 10.5.11.23 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 59 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Andrew Morton <akpm@linux-foundation.org>, "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>, Vlastimil Babka <vbabka@suse.cz>, Michal Hocko <mhocko@suse.com>, "linux-mm@kvack.org" <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>, kernel-hardening@lists.openwall.com, Kees Cook <keescook@chromium.org> |
| X-Original-Date | Tue, 26 Jan 2016 12:27:35 -0800 |
| X-Original-Message-ID | <56A7D6B7.20301@redhat.com> |
| X-Original-References | <1453740953-18109-1-git-send-email-labbott@fedoraproject.org> <1453740953-18109-3-git-send-email-labbott@fedoraproject.org> <CAHz2CGXc6=r_D1L6nUTj7A_bbX7GeUFb5+0TZWh55UUA6hiQ7w@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1318343 |
Show key headers only | View raw
On 01/25/2016 10:39 PM, Jianyu Zhan wrote:
> On Tue, Jan 26, 2016 at 12:55 AM, Laura Abbott
> <labbott@fedoraproject.org> wrote:
>> --- a/mm/debug-pagealloc.c
>> +++ b/mm/debug-pagealloc.c
>> @@ -8,11 +8,5 @@
>>
>> void __kernel_map_pages(struct page *page, int numpages, int enable)
>> {
>> - if (!page_poisoning_enabled())
>> - return;
>> -
>> - if (enable)
>> - unpoison_pages(page, numpages);
>> - else
>> - poison_pages(page, numpages);
>> + kernel_poison_pages(page, numpages, enable);
>> }
>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
>> index 63358d9..c733421 100644
>> --- a/mm/page_alloc.c
>> +++ b/mm/page_alloc.c
>> @@ -1002,6 +1002,7 @@ static bool free_pages_prepare(struct page *page, unsigned int order)
>> PAGE_SIZE << order);
>> }
>> arch_free_page(page, order);
>> + kernel_poison_pages(page, 1 << order, 0);
>> kernel_map_pages(page, 1 << order, 0);
>>
>> return true;
>> @@ -1396,6 +1397,7 @@ static int prep_new_page(struct page *page, unsigned int order, gfp_t gfp_flags,
>> set_page_refcounted(page);
>>
>> arch_alloc_page(page, order);
>> + kernel_poison_pages(page, 1 << order, 1);
>> kernel_map_pages(page, 1 << order, 1);
>> kasan_alloc_pages(page, order);
>>
>
> kernel_map_pages() will fall back to page poisoning scheme for
> !ARCH_SUPPORTS_DEBUG_PAGEALLOC.
>
> IIUC, calling kernel_poison_pages() before kernel_map_pages() will be
> equivalent to call kernel_poison_pages()
> twice?!
>
>
Yes, you are absolutely right. In the !ARCH_SUPPORTS_DEBUG_PAGEALLOC
case we shouldn't need to do anything in kernel_map_pages.
>
>
> Thanks,
> Jianyu Zhan
>
Thanks,
Laura
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option Laura Abbott <labbott@fedoraproject.org> - 2016-01-25 18:00 +0100
Re: [RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option Jianyu Zhan <nasa4836@gmail.com> - 2016-01-26 07:50 +0100
Re: [RFC][PATCH 2/3] mm/page_poison.c: Enable PAGE_POISONING as a separate option Laura Abbott <labbott@redhat.com> - 2016-01-26 21:30 +0100
csiph-web