Message ID | c7b316d30d90e5947eb8280f4dc78856a49298cf.1662411799.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 03243ECAAD3 for <linux-mm@archiver.kernel.org>; Mon, 5 Sep 2022 21:05:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F068680208; Mon, 5 Sep 2022 17:05:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EA3C7801E6; Mon, 5 Sep 2022 17:05:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D545B80208; Mon, 5 Sep 2022 17:05:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C3DDB801E6 for <linux-mm@kvack.org>; Mon, 5 Sep 2022 17:05:55 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 9E4DE1A04E8 for <linux-mm@kvack.org>; Mon, 5 Sep 2022 21:05:55 +0000 (UTC) X-FDA: 79879263870.22.EB34615 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf12.hostedemail.com (Postfix) with ESMTP id 4BC8B40086 for <linux-mm@kvack.org>; Mon, 5 Sep 2022 21:05:55 +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=1662411954; 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=VgD6aAPrK9DNDeYC6eoXfhD6gN4R30dJg8cA4lzePd8=; b=RxlSmPaRnwqLOjBsj2drvAj3zg8whhn2psRNh9NwetZna2QIK8hXbosD90G6O0Ezwk2Vb8 +cl3ju3ie7yPorJ/l2CiqTcbkoRoGpW/9uTb+dlsX2EwI2U9McjKOFN6e39iMoJchOFI1T bcSRI7JNrp9c0K5qSvvXgVNJMjtiNNk= From: andrey.konovalov@linux.dev To: Andrew Morton <akpm@linux-foundation.org> Cc: Andrey Konovalov <andreyknvl@gmail.com>, Marco Elver <elver@google.com>, Alexander Potapenko <glider@google.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>, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov <andreyknvl@google.com> Subject: [PATCH mm v3 01/34] kasan: check KASAN_NO_FREE_META in __kasan_metadata_size Date: Mon, 5 Sep 2022 23:05:16 +0200 Message-Id: <c7b316d30d90e5947eb8280f4dc78856a49298cf.1662411799.git.andreyknvl@google.com> In-Reply-To: <cover.1662411799.git.andreyknvl@google.com> References: <cover.1662411799.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=1662411955; a=rsa-sha256; cv=none; b=Lx2ANj2mD63S9oeIzmv8Tp28FSIuZSTyCB41TN+Lf5bl196kd1Rup8V9aZXM3HtY8ScjDq z4WNf9mAWImd7qXSiwMt+VK5lQs4G1vDckl4qPBzqtYhiC6XFxXfoEe1CGZDdSuA7cMcEI CHLUtDurgxYQXFNjyTJmlS9nXAhsJDA= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=RxlSmPaR; spf=pass (imf12.hostedemail.com: domain of andrey.konovalov@linux.dev designates 188.165.223.204 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=1662411955; 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=VgD6aAPrK9DNDeYC6eoXfhD6gN4R30dJg8cA4lzePd8=; b=GtH73XKhvwS13jyx3qAkFMDECJ0oAju/0xcqVZT3+b5W4pyUZjYuST1GQfJ9in0xupA0kk yZVayNeTIcQZ2DfFa1M0U0nlEnOF26/oXR8fzBVm+h6/AEe7tvdMsQ0mn6O5onH0VYe5gt vYVIpuZ6XODytAyggsX6Rf+Nm7n/jSg= Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=RxlSmPaR; spf=pass (imf12.hostedemail.com: domain of andrey.konovalov@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=andrey.konovalov@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspamd-Server: rspam01 X-Rspam-User: X-Stat-Signature: yhh7w61dbddzoou5kq8er6tpq1wimwc6 X-Rspamd-Queue-Id: 4BC8B40086 X-HE-Tag: 1662411955-82496 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 69f583855c8b..f6a6c7d0d8b8 100644 --- a/mm/kasan/common.c +++ b/mm/kasan/common.c @@ -224,8 +224,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,