From patchwork Thu May 4 13:32:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Micay X-Patchwork-Id: 9711981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1FF3D60362 for ; Thu, 4 May 2017 13:32:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1230C28427 for ; Thu, 4 May 2017 13:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03F4228667; Thu, 4 May 2017 13:32:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 43AE028427 for ; Thu, 4 May 2017 13:32:40 +0000 (UTC) Received: (qmail 22452 invoked by uid 550); 4 May 2017 13:32:39 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 22408 invoked from network); 4 May 2017 13:32:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Paun3vNiDhQ7xh4FrVi1/UjfR19W37hFy0R+f1uOCHc=; b=bIu3uCMOwc2sXQNxPePccZKMNsPIHe2h59UVPsBt7AV0WMDbFKve5soVwoHN8hwQAj 1ojoxonGGLG2YSetiKpwEdLBoIWwNwaCMZna+hL9u2EDYobZKxUDzyztur0GwVKvVwDB C9tWmcev97pLktRweaSKyr16dlawdGzAes6w230tb7H4jtSW/hyvZ9M/qxv47QLd+UIN fjgxhp0N5/H/wtsC+yrw0cn79izChbzvqf4xJ6oKmzJ9wmGzYlULlitPbKOowLlWzAJc zvpB/ZBpsFtweD/oAm5E51/kAoukPja88ezvzD2K02o/fW1veUufZ46Zq0Yv7x0t5VQi FGsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Paun3vNiDhQ7xh4FrVi1/UjfR19W37hFy0R+f1uOCHc=; b=Ss5XFeVkYiEy91LytDanc/4nz0ov173wZEeerrvnCfiFc3GVQOO6U0OwP+HO++6G5B 9nNlpNgLE+oUF2RwJQG9rUnB5MlhG01R8fvZ05n1ZJQY+5kvh2zwCV3wikYZ1+uzVev8 7v1W9TUjFpu+fScyJqp0nOXRxYyUgHJUlgIpsNH28e1c9I+Z8gb05TbQFnSU+02mWObE 5jVVg8HOds8Dtw3dwMW156vF8/AD4tKvPdGyct3GPu3OIpe+IawlpjlFWFI2XsIGs5Wr H8ZBRF18tuZlHHL3nNMfRuzFBVMJRarlaTLflm9a35xOSAt57EkR+u49kdzc7fqB3mqU aQ6g== X-Gm-Message-State: AN3rC/4R8x2f8fno5FQhvE1fJIZHwUjLe/F3CIYPNSzHcfPjQtDH8Aga fwoZaOy32lvHdw== X-Received: by 10.36.217.145 with SMTP id p139mr2020010itg.120.1493904745858; Thu, 04 May 2017 06:32:25 -0700 (PDT) From: Daniel Micay To: Kees Cook , Arjan van Ven , Ingo Molnar , kernel-hardening@lists.openwall.com, LKML Cc: Daniel Micay , stable@vger.kernel.org Date: Thu, 4 May 2017 09:32:09 -0400 Message-Id: <20170504133209.3053-1-danielmicay@gmail.com> X-Mailer: git-send-email 2.12.2 Subject: [kernel-hardening] [PATCH] use get_random_long for the per-task stack canary X-Virus-Scanned: ClamAV using ClamSMTP The stack canary is an unsigned long and should be fully initialized to random data rather than only 32 bits of random data. Cc: stable@vger.kernel.org Signed-off-by: Daniel Micay Acked-by: Rik van Riel Acked-by: Kees Cook --- kernel/fork.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/fork.c b/kernel/fork.c index 56d85fd81411..ff84ff82f56a 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -537,7 +537,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node) set_task_stack_end_magic(tsk); #ifdef CONFIG_CC_STACKPROTECTOR - tsk->stack_canary = get_random_int(); + tsk->stack_canary = get_random_long(); #endif /*