Message ID | 20220826150807.723137-22-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 0DF85ECAAD4 for <linux-mm@archiver.kernel.org>; Fri, 26 Aug 2022 15:09:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9957A94000C; Fri, 26 Aug 2022 11:09:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92233940007; Fri, 26 Aug 2022 11:09:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7705494000C; Fri, 26 Aug 2022 11:09:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 66341940007 for <linux-mm@kvack.org>; Fri, 26 Aug 2022 11:09:13 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 4AF77AC227 for <linux-mm@kvack.org>; Fri, 26 Aug 2022 15:09:13 +0000 (UTC) X-FDA: 79842076986.30.7FD7ED8 Received: from mail-ej1-f74.google.com (mail-ej1-f74.google.com [209.85.218.74]) by imf22.hostedemail.com (Postfix) with ESMTP id EE5A3C0015 for <linux-mm@kvack.org>; Fri, 26 Aug 2022 15:09:12 +0000 (UTC) Received: by mail-ej1-f74.google.com with SMTP id qw34-20020a1709066a2200b00730ca5a94bfso721685ejc.3 for <linux-mm@kvack.org>; Fri, 26 Aug 2022 08:09:12 -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=7FFI4T9ldWmH+mtJkkuNX0Iy/L7lZFULsA12RNz3xXM=; b=QeYGUAhX5R1EbSsJKxcsBcPRZBVW1PHkAvLdrlFwdXozptYGSnAUgNLSENVZNbs/pm K7DsUzuQ3O+CgsIf/IsEjZ9LO6DDEbJ/9UkwQ3NFfO5E9GyCNzZ0bQPXg5zln9YU9onl g042XVM8aCr5IqAR958NCkCsQWdTGI4OQtHiGm/rgicIY9qzg4V73Kb90uYceut/3UVw nFA6k+3xgurgpKXQPV00WyHGYNj3CUHxYWE3tNF2YhTlAM4LRfiVradwPFKvsYBl8Bzt CIjpkvmBr/QmH0E2CwFFacPDaEu6Y7HjWsctPdxYCvSgU8zQkP/JHmVv1mOQDs6l/MdM WRRw== 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=7FFI4T9ldWmH+mtJkkuNX0Iy/L7lZFULsA12RNz3xXM=; b=pbrLGnLf6FbRie67sNAMuOFP7liSP13863VteKfq2WMFrLl3wqZa1XmgtCfnCyNR0R NfiYpHSwXHLxWNMM3u0fTQEVswp5goSQYS+YCULW7NaFqi8nBr7zcRZdFosXN1psMj/9 mxkjgDsgmNupME5oeClKc4ZaepqqF+5JzRofpBQNLb9oEtKDksqf3qE0bJClGrPrKVKQ /zLizF52rhGiL+giHAfmrU8rB0+w6cD9KPwiIo7BAMxF6ZVtOy3+Ra/rnsEYoyHceyBO 6I3+hdxPq+FTtsd7F9f2sj0uqtRoqDK1b9z+89cihmHWNvaThN+udHI+Dzi0OkDqZ6Xb MYxQ== X-Gm-Message-State: ACgBeo1ZRiVr2JaSuj3xqnxLTiLvf6vN4qYdZiB97C/u3iVN3e1dYnBj HBcy3VBc3gOR787BKf2ggDAXY9ZkBTo= X-Google-Smtp-Source: AA6agR4fgqA+dojvdGvqhLNd5rEasz16MWjupX7avc3NFMUfZTqvlMHxZx6remvRJmIFi8mix2S1kZP+8vA= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:5207:ac36:fdd3:502d]) (user=glider job=sendgmr) by 2002:a17:907:6d9b:b0:731:1135:dc2d with SMTP id sb27-20020a1709076d9b00b007311135dc2dmr5939518ejc.76.1661526551609; Fri, 26 Aug 2022 08:09:11 -0700 (PDT) Date: Fri, 26 Aug 2022 17:07:44 +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-22-glider@google.com> Subject: [PATCH v5 21/44] Input: libps2: mark data received in __ps2_command() as initialized 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 Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661526552; a=rsa-sha256; cv=none; b=tGUqqCL6lfUxupebff4GwZSG2ltZuLJvSzjm97Sb1d58msRDevowZOjxYKhDwpfl3u9cc6 OO9p5fSwXWuk3/1uXPhhHUpYnNL+JWba86jnstVQjby4RzirS6e/bn5aYGXWx/oZl+Mrmf E2ftjCudbwyX3QKdFEIwBIxnpQhBbVk= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QeYGUAhX; spf=pass (imf22.hostedemail.com: domain of 3F-IIYwYKCB4AFC78LAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--glider.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3F-IIYwYKCB4AFC78LAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661526552; 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=7FFI4T9ldWmH+mtJkkuNX0Iy/L7lZFULsA12RNz3xXM=; b=Mg3YuBl56fl36ACywTH+dpDpMvghlKMbEztUTjSP68xC5wAj0uTPbSrQNt/otiZZUFXbE4 aEdAY3fZqh/+BFEESx5A77XIXYH2RDKmO/hgrFT6Gl4AozUbCBtzmWgIARVZ7cBK6MOS47 yjB1xeufuaCqzew5QJlXnXljEp31+Gk= X-Rspam-User: Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=QeYGUAhX; spf=pass (imf22.hostedemail.com: domain of 3F-IIYwYKCB4AFC78LAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--glider.bounces.google.com designates 209.85.218.74 as permitted sender) smtp.mailfrom=3F-IIYwYKCB4AFC78LAIIAF8.6IGFCHOR-GGEP46E.ILA@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam10 X-Stat-Signature: x7kf8nph6469rn58uoahwnd4uaihr9kr X-Rspamd-Queue-Id: EE5A3C0015 X-HE-Tag: 1661526552-705588 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/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c index 250e213cc80c6..3e19344eda93c 100644 --- a/drivers/input/serio/libps2.c +++ b/drivers/input/serio/libps2.c @@ -12,6 +12,7 @@ #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/input.h> +#include <linux/kmsan-checks.h> #include <linux/serio.h> #include <linux/i8042.h> #include <linux/libps2.h> @@ -294,9 +295,11 @@ int __ps2_command(struct ps2dev *ps2dev, u8 *param, unsigned int command) serio_pause_rx(ps2dev->serio); - if (param) + if (param) { for (i = 0; i < receive; i++) param[i] = ps2dev->cmdbuf[(receive - 1) - i]; + kmsan_unpoison_memory(param, receive); + } if (ps2dev->cmdcnt && (command != PS2_CMD_RESET_BAT || ps2dev->cmdcnt != 1)) {
KMSAN does not know that the device initializes certain bytes in ps2dev->cmdbuf. Call kmsan_unpoison_memory() to explicitly mark them as initialized. Signed-off-by: Alexander Potapenko <glider@google.com> --- Link: https://linux-review.googlesource.com/id/I2d26f6baa45271d37320d3f4a528c39cb7e545f0 --- drivers/input/serio/libps2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)