Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2373456rdb; Fri, 8 Dec 2023 06:26:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYpbgCXyYGEOX4QGLzoAjgDWI7DmXS+3CIyP9LK82JEaEy2HLNP5sI3aFf3q0X98JWAK9w X-Received: by 2002:a05:6358:63a1:b0:170:17ea:f4d7 with SMTP id k33-20020a05635863a100b0017017eaf4d7mr5989864rwh.36.1702045576669; Fri, 08 Dec 2023 06:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702045576; cv=none; d=google.com; s=arc-20160816; b=AFiGbDClW8typMVa7iColZIZfMAhm6eqqkZxKpSKzarfO7epZtmbqxpGYxvnmKp4+I sbm2VLoze/SyXxY1w+OBUJaRyzLDcrDUAjB+bpKhmitpCnk7lilGrsPqNCyBx7YslxiZ uQBEESjr5AC4fsqOBQJ7tbn+Std7Dgun6vM31vLCwMw+ij0FMZLdVdIEfpP+sSFxKQ8j 0ytIFLdKsSHia4qeJBPwVmgVZN4W3FF4moYVdsQNBAEewilL6MrWxbDLYzWxbaAwT5CM NpkDydpyXwNv5xmpCDN4SnjKG/Iz6jeDIS5p9I1pYKiwQ/DmIWwMN+E4UvrM77DkuahT ZXDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=gMzKOjsadOdlzFzBDSAqUHFYwgT1E5TMaJuAbqx/ofA=; fh=4F7/7GXXxyuo8X/UbjieRU7LMIhIis3FKkbV38g4Hg0=; b=eGovowYJuZnJEVjrsOa1dZt766cc4+I+0XPoVqRQMT9gkJzDvLBgQ26CItLX889o0N rKTqG8uBfUFQiAurgbUkTOySExI4A+e6HZHcJI/ass7hNeZ/7gBcJ+bYqs6mSEXa63Sh Cjb3xUQgQCU+MnxgN83owL94GQV6RI5bYSs5B6o80lclR/mviGLMA8lkuDeWyde/v/NK WtVq2+YXgmtdb979K3qZ7jnhZstNlKhZ1CqzbsU5luJhsrucNI3WAkeTp6OkqHSN8vrK m0Xc6aXqc8P+sgFkDXa7Yw/SOp0sMnGOQhY2S/+J6dtthXZ7h8UUE9cIQuBPU2DGnuwW 5vwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=et9XLQ8Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id e3-20020a656483000000b005c24211ca87si1612234pgv.243.2023.12.08.06.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 06:26:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=et9XLQ8Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 4C22281BDB8A; Fri, 8 Dec 2023 06:26:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573945AbjLHOZy (ORCPT + 99 others); Fri, 8 Dec 2023 09:25:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573915AbjLHOZw (ORCPT ); Fri, 8 Dec 2023 09:25:52 -0500 Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99C5F1738 for ; Fri, 8 Dec 2023 06:25:58 -0800 (PST) Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-58d12b53293so1061280eaf.0 for ; Fri, 08 Dec 2023 06:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702045558; x=1702650358; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gMzKOjsadOdlzFzBDSAqUHFYwgT1E5TMaJuAbqx/ofA=; b=et9XLQ8ZqQT+MVCjxwENauz7zGRsz7y+sf/oinfJ9dSLA6+risywteuJ0+D458LWYO MwigzbeYVmMop8fjsJOtrzqEMEzsSR/M4PN1AK8vKb6u0TxVVPCAhqZJkgwxkVyMbMTq SObTOJyJ2hSepeJ+g7TfRlF13ita9TzNVJBv7QEOW3eFgyphBF4hWJRLP3RvmOc3eIdn T/N5cAHLbcch8sE5N9LZLgXKK7Lcwxen3VCPL4zjHtjUIEREoSySmPiwNYK1xMPE+JQ5 W/gZZnIKJ40pOd8zBIQCdzpyY5+sHuRgcY4QSbZngUj5UvQNefCXC7ltDno2DSir7rOw p2MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702045558; x=1702650358; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gMzKOjsadOdlzFzBDSAqUHFYwgT1E5TMaJuAbqx/ofA=; b=ulf13e+HsgYWUtMXc16caCCm00VhFSBela0iCHcEQpMxgrNGORRWRVv/csk8lr9Qvj qU1LTp35ZINdZIBom2rHrpAZow7ES444xjz/QDAYNik6lA+QMv1SDQDLkEexKgWrGmgs 7AJiMUeFqiSteX4rN9s6Ie371j7CBfTIJ5tvZtOhr1xdq8Y/1ermni/ylL3ZrmXSNvOy 6mn3/ySZer+ZgOdWzxmUh2W7/LYhJcgrCDyY/T5nZIv2dF4fFJaX3E4JB6VZfCYSqwBF 7XT148pBZOxtD7388MR8t1FBtgaU896YCX9bdKxRpuIDPWhNYqngi2MTCZRHeBfzEjXl B3Rg== X-Gm-Message-State: AOJu0YzsSRNHFzcwbB3r/wiK4ERRY/BI/g2p/oduOSqBVHPf7wtj3Dc2 6TUCWq8eO9vzedudQIXnYaOnM0VFpY1pGZXkVDjhqA== X-Received: by 2002:a05:6358:10c:b0:170:4403:83a6 with SMTP id f12-20020a056358010c00b00170440383a6mr3947511rwa.52.1702045557641; Fri, 08 Dec 2023 06:25:57 -0800 (PST) MIME-Version: 1.0 References: <20231121220155.1217090-1-iii@linux.ibm.com> <20231121220155.1217090-20-iii@linux.ibm.com> <4f0eb4b4d4f6830f39555dc8a35f6ff88d6f8e63.camel@linux.ibm.com> In-Reply-To: <4f0eb4b4d4f6830f39555dc8a35f6ff88d6f8e63.camel@linux.ibm.com> From: Alexander Potapenko Date: Fri, 8 Dec 2023 15:25:21 +0100 Message-ID: Subject: Re: [PATCH v2 19/33] lib/zlib: Unpoison DFLTCC output buffers To: Ilya Leoshkevich Cc: Alexander Gordeev , Andrew Morton , Christoph Lameter , David Rientjes , Heiko Carstens , Joonsoo Kim , Marco Elver , Masami Hiramatsu , Pekka Enberg , Steven Rostedt , Vasily Gorbik , Vlastimil Babka , Christian Borntraeger , Dmitry Vyukov , Hyeonggon Yoo <42.hyeyoo@gmail.com>, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-s390@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Mark Rutland , Roman Gushchin , Sven Schnelle , Mikhail Zaslonko Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 08 Dec 2023 06:26:14 -0800 (PST) On Fri, Dec 8, 2023 at 3:14=E2=80=AFPM Ilya Leoshkevich = wrote: > > On Fri, 2023-12-08 at 14:32 +0100, Alexander Potapenko wrote: > > On Tue, Nov 21, 2023 at 11:07=E2=80=AFPM Ilya Leoshkevich > > wrote: > > > > > > The constraints of the DFLTCC inline assembly are not precise: they > > > do not communicate the size of the output buffers to the compiler, > > > so > > > it cannot automatically instrument it. > > > > KMSAN usually does a poor job instrumenting inline assembly. > > Wouldn't be it better to switch to pure C ZLIB implementation, making > > ZLIB_DFLTCC depend on !KMSAN? > > Normally I would agree, but the kernel DFLTCC code base is synced with > the zlib-ng code base to the extent that it uses the zlib-ng code style > instead of the kernel code style, and MSAN annotations are already a > part of the zlib-ng code base. So I would prefer to keep them for > consistency. Hm, I didn't realize this code is being taken from elsewhere. If so, maybe we should come up with an annotation that can be contributed to zlib-ng, so that it doesn't cause merge conflicts every time Mikhail is doing an update? (leaving this up to you to decide). If you decide to go with the current solution, please consider adding an #include for kmsan-checks.h, which introduces kmsan_unpoison_memory().