Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932141AbdCUCfd (ORCPT ); Mon, 20 Mar 2017 22:35:33 -0400 Received: from mail-ot0-f180.google.com ([74.125.82.180]:33828 "EHLO mail-ot0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756095AbdCUCfb (ORCPT ); Mon, 20 Mar 2017 22:35:31 -0400 MIME-Version: 1.0 From: Peter Teoh Date: Tue, 21 Mar 2017 03:35:30 +0100 Message-ID: Subject: memcpy without considering the get_zeroed_page() size returned To: LKML Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 621 Lines: 17 https://github.com/torvalds/linux/blob/master/arch/arm64/kernel/vdso.c /* kuser helpers */ memcpy((void *)vpage + 0x1000 - kuser_sz, __kuser_helper_start, kuser_sz); /* sigreturn code */ memcpy((void *)vpage + AARCH32_KERN_SIGRET_CODE_OFFSET, __aarch32_sigret_code_start, sigret_sz); I am just curious: depending on the configuration, will it ever happened that get_zeroed_page() ever produce less amount of memory for the above memcpy() operation to be successful? Ie, why the offset of 0x1000 is done without ever considering the actual amount of memory allocated? Please email me direct (no on LKML mailing list).