From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69F8D2B2D7 for ; Sat, 9 May 2026 01:23:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778289839; cv=none; b=bDVThoxn8FeQpAv1ASxJ8IkMfqyWz24ud3Mb0xf4huvMowncH9QOAEj81lcrVXp9BUDLj0sSsd9Sr4+wTj1NmhqXgHkew7KNUzVv1yTH/NHnMxKxPDpAT+BqdgFE6DbcPIpzpKmGumW4knFMO49EzXf4fdzaFTGQeXBwjwIxvkk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778289839; c=relaxed/simple; bh=HvCSkTOeW0AsPOjsTssVBy83+C+edCi8uFz2nAHWDVc=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=ad4ODO5Ba85gLppOGLZiLxLFT5+3ComBX84RFEWd7K7Hbor+tTyFBnHX3E+DmI5ItbJa+1IHHhmZekSHkRMII7j/+uDdHiGCn+NqRapzd1WmziPxzZwKuHya/iw8VtzR1ifTdBOiLJcO5m//Ey+OzU5RdPJ88kVzicm+u/OUIVw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=HqZDXRPF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="HqZDXRPF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12A21C2BCB4; Sat, 9 May 2026 01:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1778289839; bh=HvCSkTOeW0AsPOjsTssVBy83+C+edCi8uFz2nAHWDVc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HqZDXRPFgXofWMWfsOBNM65OXQB3cAyz35b+CntEw3YQ7by8lkxKI2hn8mWJHC7Vl Sm5+pmArShcZau2z3LiztBI7iGzR+v0VpSaX3KlREsyfCIIfqwWJlKLGjuLtw+XfTz 9unLjXcKyDIQya0xiK0SV+zJ5YbgSOezV2E616Vw= Date: Fri, 8 May 2026 18:23:58 -0700 From: Andrew Morton To: Jann Horn Cc: Dmitry Vyukov , Andrey Konovalov , Alexander Potapenko , kasan-dev@googlegroups.com, Marco Elver , linux-kernel@vger.kernel.org Subject: Re: [PATCH resend] kcov: allow simultaneous KCOV_ENABLE/KCOV_REMOTE_ENABLE Message-Id: <20260508182358.8a7775b2bfe0211c87278484@linux-foundation.org> In-Reply-To: <20260505-kcov-simultaneous-remote-v1-1-a670ba7cefd2@google.com> References: <20260505-kcov-simultaneous-remote-v1-1-a670ba7cefd2@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 05 May 2026 11:00:46 +0200 Jann Horn wrote: > Allow the same userspace thread to simultaneously collect normal coverage > in syscall context (KCOV_ENABLE) and remote coverage of asynchronous work > created by the thread (KCOV_REMOTE_ENABLE). > With this, remote KCOV coverage becomes useful for generic fuzzing and not > just fuzzing of specific data injection interfaces. > > This requires that the task_struct::kcov_* fields are separated into ones > that are used by the task that generates coverage, and ones that are used > by the task that requested remote coverage. To split this up: > > - Split task_struct::kcov into kcov and kcov_remote. kcov_task_exit() now > has to clean up both separately. > - Only use task_struct::kcov_mode on the task that generates coverage. > - Only reset task_struct::kcov_handle on the task that requested remote > coverage. > > After this change, fields used by the task that generates coverage are: > > - kcov_mode > - kcov_size > - kcov_area > - kcov > - kcov_sequence > - kcov_softirq > > Fields used by the task that requested remote coverage are: > > - kcov_remote > - kcov_handle Thanks, I queued this for testing while we await reviewer input. checkpatch asked: WARNING: Using vsprintf specifier '%px' potentially exposes the kernel memory layout, if you don't really need the address please consider using '%p'. #141: FILE: kernel/kcov.c:463: + kcov_debug("t = %px, kcov->t = %px\n", t, kcov->t); and Sashiko found a femtobug: https://sashiko.dev/#/patchset/20260505-kcov-simultaneous-remote-v1-1-a670ba7cefd2@google.com