Received: by 10.223.164.202 with SMTP id h10csp4897910wrb; Wed, 29 Nov 2017 13:53:44 -0800 (PST) X-Google-Smtp-Source: AGs4zMbv7jJ44sINB3lBu28VsYwdWRGsdTPymT5xIkhBlBoUDXETsNVJAuEsLp635xx8R67a77ri X-Received: by 10.84.240.7 with SMTP id y7mr289833plk.269.1511992424541; Wed, 29 Nov 2017 13:53:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511992424; cv=none; d=google.com; s=arc-20160816; b=KF0yM+WQNK4jbnwTEC1GFAsrc8Ycj0uhkrPS1P990lF4ThpELrq3WnzMSU552R6F7K Pom8WhMC49QZ0hRxOYCpoDD1mDaY6+Y1QU1Wr2GSN2Y2LcwJqXo0l5DvlBgsJDtztE0G vQSKJ6hVeMnqcnWcpapchHDsdbw35bXpmlpeFyTdaupCoBFvcdlsjBzmyUzeD2w6jQjJ SzhfHgqlYNWrr0Ri6K6d/AX4TVRn4R4BF5bcFIXcMuYZSIINKimTjgmAaTDpFKkcobfJ nH2RFTKlc2z+u/eHY56riZWcjHhE2784YxvMM3y3bN3p5/QtUQDnUCRRAxm7PbhWTMT2 4x3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=C82GvJ7+iZypQIpHPVzCqQ/Ad71xo30EVWSjamM/qyQ=; b=xeHcxd+MvQQRVXtr9w40E4mTKDqoFotoZoMDZgUAJxxDHJT28zwq5pHikT++BhrOCw UOpwb/y5fFYYryBwq6cTn+mglsK3ZLBnWl9dBQVMGd+x+XIXi4du5AjsD1tC8qIuN5lS s5+M/wKvjNJYV5V8x3t/tlAe+PTVD7YKZJ/PCKgUu1YQMEc+k8ldBx92tYDDFQMWjcBG Qq0ESdqoDKtieXRkeIVP+Ns9dNmRpvlpbEtIN+9ns8SfMhBfVFZytmBehbBESU7m+rqH tQOORoesF8f/9RFnfkZ9v0w6HVmnHhiFqNZOiNwkuE74156V349K73mJfW2A3tzIWzKI LxkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ivUwH5by; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20si415221pfk.92.2017.11.29.13.53.31; Wed, 29 Nov 2017 13:53:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ivUwH5by; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753030AbdK2VwL (ORCPT + 99 others); Wed, 29 Nov 2017 16:52:11 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:34009 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752186AbdK2VvQ (ORCPT ); Wed, 29 Nov 2017 16:51:16 -0500 Received: by mail-it0-f65.google.com with SMTP id m11so27582270iti.1 for ; Wed, 29 Nov 2017 13:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=C82GvJ7+iZypQIpHPVzCqQ/Ad71xo30EVWSjamM/qyQ=; b=ivUwH5bywpUJxsUTCUPFItw72G3q8DCD1HqIhd9Elj7iZRsMBlI41nfS1YgZoHRWpw NEC4bYFeUxJSSG6X2kW6mKaUnF0BcVOelHf4CFQBumPA3fAM1lTev5cFxxzPK+fM0fiq 0aIlF1RMhsAvDFBJCE2AuEC2P1IgZLISDaZma7qD8MEabaEq/yiMpgiT09dhckjSWsQm A2ZcWStpwCnk9vLUTfE62lyowJbLh6EBv32s8BGjwevCqcOcfUFT30fQDMtHBxPhWTEJ Ah/SyR+I5qhIYEpf8psk9I6kHp1h8n/ftysco4bsYcN1i9oJzU8gLpiw4wPZipC5IMtj jvcQ== 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:in-reply-to :references; bh=C82GvJ7+iZypQIpHPVzCqQ/Ad71xo30EVWSjamM/qyQ=; b=HY4h0m84E9wzUPcng8tBpXqAsE6xBGhDhfyqaeertDwr6QxgyldiVdHhEnrmRkHFNz lCgowaa83oMqkrG86g4R7AVeSclOo64kHdgW9J07racPGNvhFhwvzH3NAkRwuJBcqSXF ZnKxha7Sfr0OXwrn1OKF62ArMIYb4yDHACTAbfLMySLK1MXfmBPv9PwPftmyXMiGm47/ +6vfibKudzLDPktu/AuxLbZsKZPE663WMLMFccdtoO7SCMASY+LYKn8TY62LtN2erb8W IPSEbmGw0lssf0r4fMHh1kHDfTYPAnpFaRXMF/mIN+hfbV9LvZhGuRCezmwitE8tXAap 9LEw== X-Gm-Message-State: AJaThX4120UgnYhLflDO+ajM64hpEMgdxu4d8sLwJL9hQiV/750wqk01 EH2QnmGiUiLGOAqxHFuFyPsoRQ== X-Received: by 10.36.120.135 with SMTP id p129mr343506itc.87.1511992275242; Wed, 29 Nov 2017 13:51:15 -0800 (PST) Received: from paullawrence.mtv.corp.google.com ([172.22.120.84]) by smtp.gmail.com with ESMTPSA id x72sm1438438ite.43.2017.11.29.13.51.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 13:51:14 -0800 (PST) From: Paul Lawrence To: Andrey Ryabinin , Alexander Potapenko , Dmitry Vyukov , Masahiro Yamada , Michal Marek Cc: linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kbuild@vger.kernel.org, Matthias Kaehlcke , Michael Davidson , Greg Hackmann , Paul Lawrence Subject: [PATCH v2 2/5] kasan: Add tests for alloca poisonong Date: Wed, 29 Nov 2017 13:50:47 -0800 Message-Id: <20171129215050.158653-3-paullawrence@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129215050.158653-1-paullawrence@google.com> References: <20171129215050.158653-1-paullawrence@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Greg Hackmann Signed-off-by: Paul Lawrence lib/test_kasan.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/test_kasan.c b/lib/test_kasan.c index ef1a3ac1397e..2724f86c4cef 100644 --- a/lib/test_kasan.c +++ b/lib/test_kasan.c @@ -472,6 +472,26 @@ static noinline void __init use_after_scope_test(void) p[1023] = 1; } +static noinline void __init kasan_alloca_oob_left(void) +{ + volatile int i = 10; + char alloca_array[i]; + char *p = alloca_array - 1; + + pr_info("out-of-bounds to left on alloca\n"); + *(volatile char *)p; +} + +static noinline void __init kasan_alloca_oob_right(void) +{ + volatile int i = 10; + char alloca_array[i]; + char *p = alloca_array + i; + + pr_info("out-of-bounds to right on alloca\n"); + *(volatile char *)p; +} + static int __init kmalloc_tests_init(void) { /* @@ -502,6 +522,8 @@ static int __init kmalloc_tests_init(void) memcg_accounted_kmem_cache(); kasan_stack_oob(); kasan_global_oob(); + kasan_alloca_oob_left(); + kasan_alloca_oob_right(); ksize_unpoisons_memory(); copy_user_test(); use_after_scope_test(); -- 2.15.0.531.g2ccb3012c9-goog From 1585316208112054162@xxx Tue Nov 28 13:22:31 +0000 2017 X-GM-THRID: 1585316208112054162 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread