Page MenuHomePhabricator

Platarmboardfvpfvp Stack Protectorcvsplatarmboardfvp Rfvp R Stack Protectorc
Updated 82 Days AgoPublic

/*                                                            /*
 * Copyright (c) 2017, ARM Limited and Contributors. All r |   * Copyright (c) 2017-2021, ARM Limited and Contributors. 
 *                                                             *
 * SPDX-License-Identifier: BSD-3-Clause                       * SPDX-License-Identifier: BSD-3-Clause
 */                                                            */

#include <stdint.h>                                           #include <stdint.h>

#include <arch_helpers.h>                                  |  #include <fvp_r_arch_helpers.h>
#include <plat/common/platform.h>                             #include <plat/common/platform.h>

#define RANDOM_CANARY_VALUE ((u_register_t) 32884845509958 |  #define RANDOM_CANARY_VALUE ((u_register_t) 80923478239575

u_register_t plat_get_stack_protector_canary(void)            u_register_t plat_get_stack_protector_canary(void)
{                                                             {
        /*                                                            /*
         * Ideally, a random number should be returned ins             * Ideally, a random number should be returned ins
         * combination of a timer's value and a compile-ti             * combination of a timer's value and a compile-ti
         * FVP does not have any random number generator,  |           * FVP_R does not have any random number generator
         * nothing but not necessarily really secure.                  * nothing but not necessarily really secure.
         */                                                            */
        return RANDOM_CANARY_VALUE ^ read_cntpct_el0();               return RANDOM_CANARY_VALUE ^ read_cntpct_el0();
}                                                             }
Last Author
garymorrison-arm
Last Edited
Jul 2 2021, 9:54 PM

Event Timeline