Message ID | 20220826150807.723137-30-glider@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 C8F7DECAAA3 for <linux-mm@archiver.kernel.org>; Fri, 26 Aug 2022 15:09:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AE9394000D; Fri, 26 Aug 2022 11:09:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6378A940007; Fri, 26 Aug 2022 11:09:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B17394000D; Fri, 26 Aug 2022 11:09:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 34CFB940007 for <linux-mm@kvack.org>; Fri, 26 Aug 2022 11:09:35 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 19A0740ECF for <linux-mm@kvack.org>; Fri, 26 Aug 2022 15:09:35 +0000 (UTC) X-FDA: 79842077910.26.5C46DA6 Received: from mail-ed1-f73.google.com (mail-ed1-f73.google.com [209.85.208.73]) by imf11.hostedemail.com (Postfix) with ESMTP id B49494001A for <linux-mm@kvack.org>; Fri, 26 Aug 2022 15:09:34 +0000 (UTC) Received: by mail-ed1-f73.google.com with SMTP id w17-20020a056402269100b0043da2189b71so1226897edd.6 for <linux-mm@kvack.org>; Fri, 26 Aug 2022 08:09:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc; bh=ThlNJAw9Kex8KZrskRhHj0vt2sXcunlblCUmHxCmdH0=; b=qQ2U4pH+aEHV3VhL/BG61D7fD+fTTCboEipAha6RdIlQZwkpHT+D6S+zluEN3z1B+q p6KSrVqARRa5621nYeg6EZduZRldgx+r7wiEO2xx4Q1xdyk3NHKRP+n4BtOU+EkTRiBv n9pYohc41L9MNpZ4FFw1iKeBekfif+vSNYJKYp9IPK+WdwoL5Xq+pRz96l2kWYetAuz9 ItAJhGyVh4AlEUo/NPut7UEgT36U97b+onPRJ1+xwb33JHHm9d1XBCaLKaZdeHB78F1o GDrzwrmR2heq2RM/Ijy6NFuNEoHEGLQn9rAcq11k6RQRmGERKya5Rzxx6la0Wnscwu1/ yKKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc; bh=ThlNJAw9Kex8KZrskRhHj0vt2sXcunlblCUmHxCmdH0=; b=toAo0WFukpe3h8Frvir0lf3AyCrXntuIteLFG4DQ1lpbPXJS0vVIpKPjh1UA398IEV zQmG4rQaIaOfznR3AOva5O+Kkal0j9e6xXHrKxd35RCLFPH6WlfdZc2Lp1wn1aRhgPyo FTpQLHD+yXVZEXD2OcliKtI681D2i/roJIjXZj/ESSgvPXOOtASdOTQ6YYlgw5d0AGZ5 zVJEQ3S0rX3qeqpHNE4chFxWxjYChFnCdNtkiLuT874otST7BRghH+oqiHw2wWfp8wy4 w1eamV+6CEdw/gi6x21X4rF0B5exp//QRTbbru2UhmS1VCG9WpZJavRm+3TChxS+Gy4q bT3w== X-Gm-Message-State: ACgBeo1MdVgz4/YHA8f0ZpsKyhZ6RbzYddFamF8P47E8+7GWoNm7yXYD yo9x9av2KeDxp9hyjHFazUDgnilBMSg= X-Google-Smtp-Source: AA6agR7P1+orY1RNadpoV0ZNi4BGK9MvXVRSI3uWf43JN88nANc9J/bmowMSnW9dE0hDywQIYKYvs/S52Ck= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:5207:ac36:fdd3:502d]) (user=glider job=sendgmr) by 2002:a17:906:9b16:b0:73d:af6f:746e with SMTP id eo22-20020a1709069b1600b0073daf6f746emr5932849ejc.32.1661526573448; Fri, 26 Aug 2022 08:09:33 -0700 (PDT) Date: Fri, 26 Aug 2022 17:07:52 +0200 In-Reply-To: <20220826150807.723137-1-glider@google.com> Mime-Version: 1.0 References: <20220826150807.723137-1-glider@google.com> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826150807.723137-30-glider@google.com> Subject: [PATCH v5 29/44] block: kmsan: skip bio block merging logic for KMSAN From: Alexander Potapenko <glider@google.com> To: glider@google.com Cc: Alexander Viro <viro@zeniv.linux.org.uk>, Alexei Starovoitov <ast@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Andrey Konovalov <andreyknvl@google.com>, Andy Lutomirski <luto@kernel.org>, Arnd Bergmann <arnd@arndb.de>, Borislav Petkov <bp@alien8.de>, Christoph Hellwig <hch@lst.de>, Christoph Lameter <cl@linux.com>, David Rientjes <rientjes@google.com>, Dmitry Vyukov <dvyukov@google.com>, Eric Dumazet <edumazet@google.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Herbert Xu <herbert@gondor.apana.org.au>, Ilya Leoshkevich <iii@linux.ibm.com>, Ingo Molnar <mingo@redhat.com>, Jens Axboe <axboe@kernel.dk>, Joonsoo Kim <iamjoonsoo.kim@lge.com>, Kees Cook <keescook@chromium.org>, Marco Elver <elver@google.com>, Mark Rutland <mark.rutland@arm.com>, Matthew Wilcox <willy@infradead.org>, "Michael S. Tsirkin" <mst@redhat.com>, Pekka Enberg <penberg@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Petr Mladek <pmladek@suse.com>, Steven Rostedt <rostedt@goodmis.org>, Thomas Gleixner <tglx@linutronix.de>, Vasily Gorbik <gor@linux.ibm.com>, Vegard Nossum <vegard.nossum@oracle.com>, Vlastimil Babka <vbabka@suse.cz>, kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Eric Biggers <ebiggers@google.com> Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661526574; a=rsa-sha256; cv=none; b=DFt+DJZn5FSMrrvt5VCknUtmHnPSOMf4Zd1zirAzbcAqPQyc4ACXLeXeee6jHeCEKBSRve PqmIsL4jSZfqjhiYKHpumMfLn05soYtGlXXOJatntYzpjd/QjhQj6t74CK4znexgkjKxsT wS4r2trOLTEpHpjlG7r9PeXDC9bNmnE= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=qQ2U4pH+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf11.hostedemail.com: domain of 3LeIIYwYKCDQWbYTUhWeeWbU.SecbYdkn-ccalQSa.ehW@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3LeIIYwYKCDQWbYTUhWeeWbU.SecbYdkn-ccalQSa.ehW@flex--glider.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661526574; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ThlNJAw9Kex8KZrskRhHj0vt2sXcunlblCUmHxCmdH0=; b=g5uGvQYtYGV7k4pXqBX+kiTMSGxDQmwxiiOsOeK/RArmHz7RP0ZzzQ8C6Apx/5ZzXVZ+PM Jy1e3BKsZG+Aym/II4mtsYI8IzTtSRtdjZAp7KAg3d7a7QE9hbZPG23ytH568berjQZA2v KSkIhVo9iwhz1jJd0yMWzWOb25jG3o4= Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=qQ2U4pH+; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf11.hostedemail.com: domain of 3LeIIYwYKCDQWbYTUhWeeWbU.SecbYdkn-ccalQSa.ehW@flex--glider.bounces.google.com designates 209.85.208.73 as permitted sender) smtp.mailfrom=3LeIIYwYKCDQWbYTUhWeeWbU.SecbYdkn-ccalQSa.ehW@flex--glider.bounces.google.com X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 8119rm4a9d8hnp4s6p4rwgjxkjt99jha X-Rspamd-Queue-Id: B49494001A X-HE-Tag: 1661526574-601820 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 |
Add KernelMemorySanitizer infrastructure
|
expand
|
diff --git a/block/bio.c b/block/bio.c index 3d3a2678fea25..106ef14f28c2a 100644 --- a/block/bio.c +++ b/block/bio.c @@ -869,6 +869,8 @@ static inline bool page_is_mergeable(const struct bio_vec *bv, *same_page = ((vec_end_addr & PAGE_MASK) == page_addr); if (*same_page) return true; + else if (IS_ENABLED(CONFIG_KMSAN)) + return false; return (bv->bv_page + bv_end / PAGE_SIZE) == (page + off / PAGE_SIZE); }
KMSAN doesn't allow treating adjacent memory pages as such, if they were allocated by different alloc_pages() calls. The block layer however does so: adjacent pages end up being used together. To prevent this, make page_is_mergeable() return false under KMSAN. Suggested-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Alexander Potapenko <glider@google.com> --- v4: -- swap block: and kmsan: in the subject v5: -- address Marco Elver's comments Link: https://linux-review.googlesource.com/id/Ie29cc2464c70032347c32ab2a22e1e7a0b37b905 --- block/bio.c | 2 ++ 1 file changed, 2 insertions(+)