Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7541648ybl; Thu, 16 Jan 2020 01:11:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzDlifLhj8/HuzsdmR6PHEHp7gZ9HPlpcCPd/n78hC5WYjZf3wSZpK/vq86kbuDiso0upkr X-Received: by 2002:aca:cf58:: with SMTP id f85mr3391908oig.6.1579165904192; Thu, 16 Jan 2020 01:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579165904; cv=none; d=google.com; s=arc-20160816; b=oL3CStZLq+rgQIDCwTT5wSoaeVU1z98yE6o4jCu492/G65HQ3J3WUJES4GIhiZiGYu +G7APCbwwYFMC9BV/YxkPnG7njcnAZsobD19yVw4QgvLo+G0LRaflbeaVH3s6XJeEgmO F/SKHpq0zTfYmPkbOnBomYFFqAlFbib/V8QpAv/xrlaUp677BFzmtD7qgH0cD1skt6c3 pNFVWn0PUIVU5UKjrFgjwHy+Dzb02C3x4OGOlTtAxHA2xXXVQ3giHHGsudSjdG31TQkt JfE6Bv0fio9Nn8ll/l+HY5jLGbtSt+dKOkn4M3cpR4IIUN50saRAxs30Zv0sA8IUDBJU LL5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lq1lgQepAiLQTChN85kcSpVDrR+IKCYkY9dHTqAQDcM=; b=uFo5w0jF4nISNUalr8amavj1LWguq+RA5/EsTRqpSlRVQeVym7+I9KrOkXAuVrFN3i BU08fZVgkRD2NwczgXqejzFQ4wjYunFGR8t9/6NSyHwh9xpp74wa0piawFqIyhICI2Iu eLy+xXWq/mJSoseSCJY712Yid34khPal40ys++8n3kYJQEmyHJHuJSdvaAFngCyeqCoT Hq+1kcIzJgyomme//3+DaCzo1XkyFjXTpGiWfAKhfKZw0zj9ajtg8HrD2NPgDNzzXgGC GEXga8rgDY7MB7Bw3i0zeSKptEEHo1UQ9Poh4aKvPw/1P4wYglVLbOZcDykzaWp7vATn hqzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Zi64Kg7K; 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 j24si13718171otk.76.2020.01.16.01.11.30; Thu, 16 Jan 2020 01:11: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=Zi64Kg7K; 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 S1731583AbgAPIxF (ORCPT + 99 others); Thu, 16 Jan 2020 03:53:05 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:39838 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726970AbgAPIxE (ORCPT ); Thu, 16 Jan 2020 03:53:04 -0500 Received: by mail-qt1-f196.google.com with SMTP id e5so18252691qtm.6 for ; Thu, 16 Jan 2020 00:53:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lq1lgQepAiLQTChN85kcSpVDrR+IKCYkY9dHTqAQDcM=; b=Zi64Kg7KK+B5haudW5HjEa7F3ZDfapczeiCEACOCF6FEfhyd1F04IlvUIvbckZfhqB m5sHC5SL4LAcnuxn/vVVOmQbYFMcO4SWSHhUcMEuRzAnOOusbAnVNsgIWB7Y3nVEfQNS KIg3Kf+jJxzjnO2LkgXozRl0F6jtbORpL73RvFHzW1BlE9ckNdoKGPncI2reSsC9WUFR 6xM2TZVBsILLq/bDpXavek7w2D6/94aBUKCp0qA0fPFplpitW+w8PFFlO4R6eCnezkue 3CEAXw8uufTK7n7vhhlTsl2SLfQJQAGmfYU04sa7vVYg3cwBxenTCklXZTmfkuCPHWGY UZXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lq1lgQepAiLQTChN85kcSpVDrR+IKCYkY9dHTqAQDcM=; b=MULJl9fb4b6vuGuD5gss+/x2uYfPraQCQNe+V64/8Ycgv1lhH3btlzGZLqHVB0PC2C tMap7zT7XWzlsTXHTnoyiVK5KWGVUj4BFkbJG2rLCpugg7MlR9sFGo22a/GNznOtplPt qRTSzir4lzC7UBABGNlVlbpdJ8A2T01GTcSQLKLx8ceE8+O7BbZP7YO8h0ISv67rNLM3 8/FUZDtGLT7WWYBpBrzhqK+rkvma9pMOR/4I43xK4ATLNJpAgJOeFUiJNHi4a4afNqL8 DfyNIjTgBHFfPaPbDAkhF7C8w5veeuiq74P/JbAFISxdnfemL6N+Gu1RYRDGJKKXuLb2 0u5g== X-Gm-Message-State: APjAAAVzSAjkwHIPyAmCFyeKBTP75djKqflUymP6McSpaQMlh/c+8MLW ESJxFlqrvzAn4ykl6d+Ia696IW5NzEMabsJVqfZjqg== X-Received: by 2002:ac8:24c1:: with SMTP id t1mr1305434qtt.257.1579164783430; Thu, 16 Jan 2020 00:53:03 -0800 (PST) MIME-Version: 1.0 References: <20200115182816.33892-1-trishalfonso@google.com> In-Reply-To: <20200115182816.33892-1-trishalfonso@google.com> From: Dmitry Vyukov Date: Thu, 16 Jan 2020 09:52:52 +0100 Message-ID: Subject: Re: [RFC PATCH] UML: add support for KASAN under x86_64 To: Patricia Alfonso Cc: Jeff Dike , Richard Weinberger , anton.ivanov@cambridgegreys.com, Andrey Ryabinin , David Gow , Brendan Higgins , linux-um@lists.infradead.org, kasan-dev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +void kasan_init(void) > +{ > + kasan_map_memory((void *)KASAN_SHADOW_START, KASAN_SHADOW_SIZE); > + > + // unpoison the kernel text which is form uml_physmem -> uml_reserved > + kasan_unpoison_shadow((void *)uml_physmem, physmem_size); > + > + // unpoison the vmalloc region, which is start_vm -> end_vm > + kasan_unpoison_shadow((void *)start_vm, (end_vm - start_vm + 1)); > + > + init_task.kasan_depth = 0; > + pr_info("KernelAddressSanitizer initialized\n"); > +} Was this tested with stack instrumentation? Stack instrumentation changes what shadow is being read/written and when. We don't need to get it working right now, but if it does not work it would be nice to restrict the setting and leave some comment traces for future generations.