Message ID | e4a075c43dc6793253976780311543fefd82cba3.1658189199.git.andreyknvl@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA32CC433EF for <linux-mm@archiver.kernel.org>; Tue, 19 Jul 2022 00:10:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B46E76B0071; Mon, 18 Jul 2022 20:10:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ACDFE6B0073; Mon, 18 Jul 2022 20:10:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9966E6B0074; Mon, 18 Jul 2022 20:10:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 868B46B0071 for <linux-mm@kvack.org>; Mon, 18 Jul 2022 20:10:21 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 5F73761521 for <linux-mm@kvack.org>; Tue, 19 Jul 2022 00:10:21 +0000 (UTC) X-FDA: 79701917442.14.31CAE0F Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf01.hostedemail.com (Postfix) with ESMTP id CC7EA40062 for <linux-mm@kvack.org>; Tue, 19 Jul 2022 00:10:20 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1658189419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sonD4+6h/lo8DkbhcKGrk86DBB0a/jVHQ/3znGtvMfA=; b=u99oHTV4VK/O3TDCdr5cCAEgrJ0jSsoO5ddoGvb111Gk6pLjAVWDvqrVzYNb7Wb/JyF6z6 HAZwpFa7j7U8ObOXHgsxkEZpgJ8X6wiOd0lmPxRowWlTEfUSAiRqIEO+4NVcziy0BwUP3O Sw7eRvUMkT3fiiNsPZFOuWOY/PN858I= From: andrey.konovalov@linux.dev To: Marco Elver <elver@google.com>, Alexander Potapenko <glider@google.com> Cc: Andrey Konovalov <andreyknvl@gmail.com>, Dmitry Vyukov <dvyukov@google.com>, Andrey Ryabinin <ryabinin.a.a@gmail.com>, kasan-dev@googlegroups.com, Peter Collingbourne <pcc@google.com>, Evgenii Stepanov <eugenis@google.com>, Florian Mayer <fmayer@google.com>, Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov <andreyknvl@google.com> Subject: [PATCH mm v2 01/33] kasan: check KASAN_NO_FREE_META in __kasan_metadata_size Date: Tue, 19 Jul 2022 02:09:41 +0200 Message-Id: <e4a075c43dc6793253976780311543fefd82cba3.1658189199.git.andreyknvl@google.com> In-Reply-To: <cover.1658189199.git.andreyknvl@google.com> References: <cover.1658189199.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1658189421; a=rsa-sha256; cv=none; b=3jeDGefydCZPd7jo1WkeVTUYiykljLA0j/JTLBrdbTpe95MmBvA5SffFY9qF9vpJa2wO4Q QwKfn8LnaiwlOjYuejoX3A5Yqpuu2dveRTcfpL3C06S7MosGqQAERCmXa0l3hInTk63W6q 9cevsP8sogaxiKpJ4EVw4tYfeNGua4Q= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=u99oHTV4; spf=pass (imf01.hostedemail.com: domain of andrey.konovalov@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658189421; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sonD4+6h/lo8DkbhcKGrk86DBB0a/jVHQ/3znGtvMfA=; b=ab6j+siz1BWOC8qYFIf7wcP0PseNITC+QdZEMD150ELjjQmYbGdtetq4TxQEJ3CLz3zZGU fyxE0D3p7Dxk+brt72Rdtvp3GDqtQ6yy9GkN+3b6IEZGX813bj9ybY1j5Wiwvwpf64N4C0 V1pCg631P+1o5GgGY6kkj3cTo6Ck30E= X-Rspamd-Queue-Id: CC7EA40062 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=u99oHTV4; spf=pass (imf01.hostedemail.com: domain of andrey.konovalov@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: ffmkayyeh19bdwn6zudxi3eg3hteiujb X-HE-Tag: 1658189420-393813 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
kasan: switch tag-based modes to stack ring from per-object metadata
|
expand
|
diff --git a/mm/kasan/common.c b/mm/kasan/common.c index 707c3a527fcb..b7351b860abf 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -223,8 +223,9 @@ size_t __kasan_metadata_size(struct kmem_cache *cache) return 0; return (cache->kasan_info.alloc_meta_offset ? sizeof(struct kasan_alloc_meta) : 0) + - (cache->kasan_info.free_meta_offset ? - sizeof(struct kasan_free_meta) : 0); + ((cache->kasan_info.free_meta_offset && + cache->kasan_info.free_meta_offset != KASAN_NO_FREE_META) ? + sizeof(struct kasan_free_meta) : 0); } struct kasan_alloc_meta *kasan_get_alloc_meta(struct kmem_cache *cache,