Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4361099ioa; Wed, 27 Apr 2022 01:57:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPRW66B6yK1YFl8XN2H3+B7yTIk4OTLm52A5Ep7oxwDpQSu2XJSUI4n2nDghZ52tYnQGjm X-Received: by 2002:a17:902:b106:b0:159:5c6:cb53 with SMTP id q6-20020a170902b10600b0015905c6cb53mr27755144plr.99.1651049821481; Wed, 27 Apr 2022 01:57:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651049821; cv=none; d=google.com; s=arc-20160816; b=AtSfaSR8Wu8BywHJicG2r480bbitfrEr2TGupXisl/1Pq5klaysy1yEPbyDTboFooM NP/ErzGkcJIlAvQzIeyoCkB6UMWi2aZb3uzDgQ9FkXm/tcObroNqW4LX0FaI2gRqeKAe 6jdDvJ+qFYsIqPQYdopsOj+LLa3Q8MkoRmjW4UU4JUO90/CFDe45oMC6CuSiEpFxyH30 8vmfT1qhBF1liXoym/EIQSzvI+5PbVfN/1Uu0bf0Ia4CwDNH8Lgl2pYLptXRcYs6ZN4N G5zHD4y/YIVla474QqSIOulwqi7WEikoH3ehp5HbTy6RmGKSP//+toc38JCp96SzMvOx lA4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=A4BOD5bYYCwqT6UysGwaTqw9NZkJge0TWQm9U6+WrG0=; b=xP2Kv5G1zNFDcERIM8pDIWdNPe/S0C1r+igWuLhNyOycCMdJsU3D1Lnh5Wt8+12tob Vrixr+uqwjVB86cSN9R2KK5fvRD0VADNm/4t5z3ZBU5LuE203rB/YeTNkHmox6SGXMK4 QjmN150Qj1RT0kHraP9vD9O3w5orV62cZX8zw4N3QC0fiHfl3J84Dpsrkr4gDU56Ze3x 3rfd2PimWSLWjNc90fVqfYx+j5RtKH4VPxEISYCcv065y3QNXmGiX7LM7Ov58L+5g2JL plmRgfv++SmQYwLXFgMdQ4UtDjxB5X5HwtGn3ZtC5e+KEezDs1LMkDSrLiwJZN38MAcg FxFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=khSFQmZP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id n38-20020a635926000000b003ab24258fa6si777343pgb.720.2022.04.27.01.57.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 01:57:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=khSFQmZP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 121701C894C; Wed, 27 Apr 2022 01:54:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353370AbiDZQvK (ORCPT + 99 others); Tue, 26 Apr 2022 12:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353296AbiDZQtL (ORCPT ); Tue, 26 Apr 2022 12:49:11 -0400 Received: from mail-ej1-x649.google.com (mail-ej1-x649.google.com [IPv6:2a00:1450:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11C6E3BBFD for ; Tue, 26 Apr 2022 09:45:22 -0700 (PDT) Received: by mail-ej1-x649.google.com with SMTP id i14-20020a17090639ce00b006dabe6a112fso9272160eje.13 for ; Tue, 26 Apr 2022 09:45:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=A4BOD5bYYCwqT6UysGwaTqw9NZkJge0TWQm9U6+WrG0=; b=khSFQmZPrfoPgxGEUABi/FVW8V9rw4+gcS76epQACJKqyg7hkcjwrrNZSEPqT8cKN9 ONCpTChsOEZ0awUUpbA5x5xayPRdehOMzeg0fmzK8U1O+otCttBP994AhBNpWeRijLhC uA0BFEVHSShFszO60gnvZ/g8XEEAvlCsHxSsQtTYtMUoAiTqbiLeIdThYaket6Dbkru7 YLDTtMsAFMm7WODYFRUO4LbdZSTFrmTAN4yb5OHT1IcBSYVtVTBthQ8DYmMN9xjdT8Y5 P4oaK9oxiUba69g6lk7NgMT+HmLDsQRoGLtP+vFJRnamxCbKjs/0LNdi6KunA8g68VkO EfjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=A4BOD5bYYCwqT6UysGwaTqw9NZkJge0TWQm9U6+WrG0=; b=o/6EEklGNHs3UoKQ5NpmvZiPHUr3KEVMdjsBbah/HagI+mN2RFrszMCasuVfcWxcW2 Ery03/Lu80GXuRqVxpIwLfS2y8lgnoTxsIwXMkan9sDCIHlSnyZ+PVljZHNmSImmej3l 4Ph1YcO5If15uAKnbRcO7bTbfJDajrebAii/yz1rzM2jFt1oVMJhqONhUX1RxvVL7lbe FipAiEScCQbzFOojAjAqIsDKmTruabtl85Q5vBhCcZQHHzmGLdZlw+4Tf0K059300iE9 12gl8SUuo3EsTQUjVwdXw6I/Sdjw8qLktahq2a1qgZIvGOmiPI6vr66ixC62UqU5QGjD eIJw== X-Gm-Message-State: AOAM533inHhX1GuZ5PodpRXlwmJZVu9+0Plit4YJa5+pxFlOsz66pYp3 wOMCvkZb/v0/gd/siYoNqC3p/m9NXbE= X-Received: from glider.muc.corp.google.com ([2a00:79e0:15:13:d580:abeb:bf6d:5726]) (user=glider job=sendgmr) by 2002:a05:6402:254e:b0:424:244:faf with SMTP id l14-20020a056402254e00b0042402440fafmr25661420edb.260.1650991520418; Tue, 26 Apr 2022 09:45:20 -0700 (PDT) Date: Tue, 26 Apr 2022 18:42:52 +0200 In-Reply-To: <20220426164315.625149-1-glider@google.com> Message-Id: <20220426164315.625149-24-glider@google.com> Mime-Version: 1.0 References: <20220426164315.625149-1-glider@google.com> X-Mailer: git-send-email 2.36.0.rc2.479.g8af0fa9b8e-goog Subject: [PATCH v3 23/46] Input: libps2: mark data received in __ps2_command() as initialized From: Alexander Potapenko To: glider@google.com Cc: Alexander Viro , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Marco Elver , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , 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" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Link: https://linux-review.googlesource.com/id/I2d26f6baa45271d37320d3f4a528c39cb7e545f0 --- drivers/input/serio/libps2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 #include #include +#include #include #include #include @@ -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)) { -- 2.36.0.rc2.479.g8af0fa9b8e-goog