Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2667060ybl; Mon, 20 Jan 2020 07:12:21 -0800 (PST) X-Google-Smtp-Source: APXvYqwxDqsSkrfmbmrZnBpAjGjPmT+5wweXlX+VN+aOeejPZH+Sob0HYPI2iGDHieQ8ut5Ffo3z X-Received: by 2002:a9d:7305:: with SMTP id e5mr15835226otk.64.1579533141674; Mon, 20 Jan 2020 07:12:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579533141; cv=none; d=google.com; s=arc-20160816; b=hVK4LYgLQwVPCY1KYRqeiwkyACGc5tO2ynXCIJEETMrY9CN9OqBG/SMlxuFj6TcTN+ n4F6JVJ8pnBUKKL8FKn+ktGIZso4sc0sVm+kSh7YA+ZdWVgD01EsUyI82PemYqQTidEF HWibr2tckZcmYqYI5Sk2FYdZBN9Z06zEDicwpmNYYTOVG6wHQM/SBSIJfsnuaaaquv2n XfrPYcq1Zp736/5CDCoee5QRry9gxeVeE6Id6dq91BRhaAnXfkj+KsDnMyuinWDG46gP Uzc4HqYaj03zNPqlFacJopb8nFKjByzhgfnYFILUtzHfcfwWyhiACll67+SEH65y5SzF n5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=TQoSylkDTjGNW+otOWNEut12k2291qZWwUfCl+hYpEQ=; b=JQy74mhsdGKfM8zscRMKEuR9ZYADOVllY7lxAzZ4btnpLdTUoJZBEuaJX7/Uvv1NGo fxMvZ7QICz7YDawy4wBPAXael8RDDicixZixi174AyNpC2x5DN11Q3qZsf43h5KjhbZc MFBMsGyrL5vZ9JBFwgRLWleKB+4xcipnAMKbjTC812pY3rc6zNMtiT66EVMufTyRhGWo vzY3xA+v9KLkjiGcFRpqSTidbZvbbWpH0CM5RNd7y/0hOyPZdsXizWsj7ckNkfIwK3s6 s6PqWGaKsyZKmWgstpgvi48kCycyJ+njrw2PIhCx7hOu8RoOdcGrFeNNtnHnqzCeWocH O9mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vQchanyu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si16329077oic.12.2020.01.20.07.12.09; Mon, 20 Jan 2020 07:12:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vQchanyu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728093AbgATPLN (ORCPT + 99 others); Mon, 20 Jan 2020 10:11:13 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:44343 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726860AbgATPLM (ORCPT ); Mon, 20 Jan 2020 10:11:12 -0500 Received: by mail-oi1-f194.google.com with SMTP id d62so28706790oia.11 for ; Mon, 20 Jan 2020 07:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TQoSylkDTjGNW+otOWNEut12k2291qZWwUfCl+hYpEQ=; b=vQchanyuO70Z5EGQnoMxx1gScqFQzlQR4A5b+1yUyTm5zGPm9br/FIVu4v9HRD57H7 7Z2uFgqE6uNowRlgQDT87nV2pFknhrlTNSZB3/gQcc872TfzH+7KraS6DjWAXeAa0i/V QJojrBCtgsGr1GHDAu8O/Tbj3LOBpHBltF19yQNeIzKc1+9Wc85AsqSGZBDholF1//W1 rqmBKMJo8kxtKbIfAIP9O0jOrShRo9ET/nTs00X6u8QnFWjK/ySQQb/5Pv3h9EyiWUxD 9bme+MpIHHhE09cnW3tQHBCplvmqD++2jibFLjF4lSr/sfjClXQZ6ZAkKU9Zfxu2EZ29 MDYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TQoSylkDTjGNW+otOWNEut12k2291qZWwUfCl+hYpEQ=; b=BV8cOWeRSeuArDWcgWZFaEC7ZuBWIjdmpi2DTxvGsQ72NVviotl0SAhXLDItJWhVM+ G7R+vhKwIoZPg1USDmpK4IbKDbfW+7gg9lL3U4B3hy88Y8GZYy9g1IqY/ZsNmaJQVync 0Kn0dJeifVCVHxbP4yGf0gS+ZlOEVvpr1c1XwTV6gzaFldlNIQEDn6/jGPzFLcFra2Zz eNXhwcMAzsP2N6TksIpLXrfY0WI3rB/paPI95ayfaogJajmJK914cu3WwybjHmoKD9OL iyJR3tTkUuNwidgrq2zZ6sYclyuDPh2YUri4QTVJi9e7Y/qh4bVnTGXM5gz5myKJAcva c80g== X-Gm-Message-State: APjAAAXEGIJwMYQsuMV1QnAM3SQBG1RlQfTcmKq2xjWV69Z+vKnjWEiT E/KjIVKMfSkxyz14P/E6uTaEccB4Huwf4Sn9PfArKg== X-Received: by 2002:aca:d4c1:: with SMTP id l184mr13228717oig.172.1579533071637; Mon, 20 Jan 2020 07:11:11 -0800 (PST) MIME-Version: 1.0 References: <20200115165749.145649-1-elver@google.com> In-Reply-To: From: Marco Elver Date: Mon, 20 Jan 2020 16:11:00 +0100 Message-ID: Subject: Re: [PATCH -rcu] asm-generic, kcsan: Add KCSAN instrumentation for bitops To: Arnd Bergmann Cc: "Paul E. McKenney" , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , kasan-dev , "linux-kernel@vger.kernel.org" , Michael Ellerman , christophe leroy , Daniel Axtens , linux-arch Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Jan 2020 at 15:40, Arnd Bergmann wrote: > > On Mon, Jan 20, 2020 at 3:23 PM Marco Elver wrote: > > On Fri, 17 Jan 2020 at 14:14, Marco Elver wrote: > > > On Fri, 17 Jan 2020 at 13:25, Arnd Bergmann wrote: > > > > On Wed, Jan 15, 2020 at 9:50 PM Marco Elver wrote: > > > > > If you can't find any, I would prefer having the simpler interface > > > > with just one set of annotations. > > > > > > That's fair enough. I'll prepare a v2 series that first introduces the > > > new header, and then applies it to the locations that seem obvious > > > candidates for having both checks. > > > > I've sent a new patch series which introduces instrumented.h: > > http://lkml.kernel.org/r/20200120141927.114373-1-elver@google.com > > Looks good to me, feel free to add > > Acked-by: Arnd Bergmann > > if you are merging this through your own tree or someone else's, > or let me know if I should put it into the asm-generic git tree. Thank you! It seems there is still some debate around the user-copy instrumentation. The main question we have right now is if we should add pre/post hooks for them. Although in the version above I added KCSAN checks after the user-copies, it seems maybe we want it before. I personally don't have a strong preference, and wanted to err on the side of being more conservative. If I send a v2, and it now turns out we do all the instrumentation before the user-copies for KASAN and KCSAN, then we have a bunch of empty hooks. However, for KMSAN we need the post-hook, at least for copy_from_user. Do you mind a bunch of empty functions to provide pre/post hooks for user-copies? Could the post-hooks be generally useful for something else? Thanks, -- Marco