Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp756718ybl; Fri, 13 Dec 2019 04:12:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy55Oe4tB+Wm1sNIleG4Qh0Lwz/iIE5cILy0PdXynDlzDyqPyEkT6UorSuM0Am7OrBWXmAq X-Received: by 2002:aca:4c9:: with SMTP id 192mr7189644oie.105.1576239152815; Fri, 13 Dec 2019 04:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576239152; cv=none; d=google.com; s=arc-20160816; b=tHFudJu2Z+37yfsYb0RGGe29q+1j/CgNNI1iEe9VUPGtOKVvXJf+m70ytGW1R0fPx1 6QLGj8XLAGe4jka7TAOvcF9cc98XuQ5VyKNQzWhGyMgl25m8/20m7ux2fEoJutXbETH5 J4d9Yh12JHthAbbIpg33qvtic9yS5E3LTijaLrHBJ6Wd7+vmC9pgQSIASFD6bN00Itec GrjHQFP42vsc5y2I2DmX1Ifx8oRW3xDz4hBaIDkOaGvfHwAoE1cmW+R4pRnizsDNFFPa NASnpu9AbDhwklPHgfrpEfXVVCnRJvbPsuVasBJYwqSsI5Ad7/9kjZlc4QqyS6Sv1NQB zAww== 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=9r3y5b2vXMIRb8oNblHHWyiR/x9JBMIKMp7Nl/AMSRg=; b=o0UF9W4ckXDQvx0H9C3lUJHCrZckA1y5Qb4iZJf055YLYOK39PGHfKuFJHv/MN6zL5 HatbqoG1+VyiBYEC9S5nLlLrWun+OhJfJ/nqTzcLiH9fuWzVW7fMD8fOUyJLjoV4ONNb mZbFJwoCfidHfOACZRccC+JGDvyzrVEqaTZMKVab6aMOevgCgtaJhyesiYR2tsiWhMXC CA7AyEEfy2BXjn1yvpWpAkL3w+abi4rIbbQWboPScbMRellwkVpJ5PWmwmMAFJ8QCJ+n 6KAAy+/8gWtXdRb6h4KhCRRJA4SqtRxViy3h//GiJ7NxhkPGZATsLFGdQCXXVSV8VJBs +oKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ftJJ7cj5; 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 w24si4717901oic.260.2019.12.13.04.12.21; Fri, 13 Dec 2019 04:12:32 -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=ftJJ7cj5; 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 S1726967AbfLMMLj (ORCPT + 99 others); Fri, 13 Dec 2019 07:11:39 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:43900 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbfLMMLi (ORCPT ); Fri, 13 Dec 2019 07:11:38 -0500 Received: by mail-pj1-f65.google.com with SMTP id g4so1119671pjs.10 for ; Fri, 13 Dec 2019 04:11:38 -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=9r3y5b2vXMIRb8oNblHHWyiR/x9JBMIKMp7Nl/AMSRg=; b=ftJJ7cj5skjnr4OfwFizJQnyDilL8KDJLUSdnajj31APdfbww2kYdJaC5q7N2wedfa HkoO/nl7SIDvINoANdm2hSw3WnaoPBko5o3vkkgaNBaA9koBKRUPSUQ0ueMwMuAnRSNc g/GE0hCDxB+nXjFmP/aZSP0oYJ22nLzaChBYHTio+9S8oof8F4cYfcYLDNxYFwk+Dyj3 NSLGahEYWM7sQbGlFL59techMRpz00kQeHMO4rGpIuWTMVa7dzjE7fzVhBMsUWa7B23o T9D+Wh8sI54DIfEDt7YgD9M5hrEMA/0x4gzlacknbtyZEDeJYyB66MZyeSq2UYTGXfHf QJ3g== 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=9r3y5b2vXMIRb8oNblHHWyiR/x9JBMIKMp7Nl/AMSRg=; b=WWCEMcZdc6Gu+ajWNybY4agCC8cwspVjNQCdnb+iLccVeSNitTxx5tWyVQDBoWdkSf SPGjp5qF4gOQzb92K1JquqBCLAiiY9TuK+i0OgoLt/BzRIEdoWOuJqxvjY01GmlSikmu 8QDFcNrQ5TWet97Ejrv59pV1oCdzmjBojJNKyc0UdoTaposLbJyzFOJKjQA3zWgGfDOT WFLShHReFQwqRyBGAn+1OpEAQJPRA10Uw/6XYo0ELOMH8DW4+1yOs1MsgcR3Hsg4GH4h AtRxkMwUA9l0pXVJRRaNxHH96wF667wg4gdHjwYyWt2Xam1VmVdcNAua5TJRQS30bCa6 9+lQ== X-Gm-Message-State: APjAAAWApyJ1uXJu0WAi9I/RokNvhjboGp7cyOIa2TCTYVeEpopLDpVN E/kxKADk+09nIkt+ZVqV0+mVc0jMHPDhiS05IE6+pg== X-Received: by 2002:a17:90b:150:: with SMTP id em16mr15813824pjb.123.1576239097699; Fri, 13 Dec 2019 04:11:37 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Andrey Konovalov Date: Fri, 13 Dec 2019 13:11:26 +0100 Message-ID: Subject: Re: [PATCH RFC 0/2] kcov: collect coverage from usbhid interrupts To: Dmitry Vyukov , Greg Kroah-Hartman , Alan Stern , Jiri Kosina , Benjamin Tissoires Cc: Andrew Morton , USB list , linux-input@vger.kernel.org, LKML , Alexander Potapenko , Marco Elver 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 Thu, Dec 12, 2019 at 6:15 PM Andrey Konovalov wrote: > > This patchset extends kcov to allow collecting coverage from interrupts > and then uses the new functionality to collect coverage from usbhid code. > > What I'm not sure yet about this change is if we actually want to > selectively annotate some parts of the USB stack that are executed in > interrupt context, or maybe we can do this with some common approach. > > For example patch #2 in this patchset annotates all functions that are > passed as completion callbacks to usb_fill_*() in drivers/hid/usbhid. > Maybe instead we could redefine usb_fill_*() in a way that would handle > all such cases without manual annotations. Although looking at this again today, it seems much more logical to add kcov annotations around the complete() callback in __usb_hcd_giveback_urb(). Don't know why I didn't think of that. Will do in the next version. > > Any suggestions are welcome. > > This has allowed to find at least one new HID bug [1], which was recently > fixed by Alan [2]. > > [1] https://syzkaller.appspot.com/bug?extid=09ef48aa58261464b621 > [2] https://patchwork.kernel.org/patch/11283319/ > > This patchset has been pushed to the public Linux kernel Gerrit instance: > > https://linux-review.googlesource.com/c/linux/kernel/git/torvalds/linux/+/2225 > > Signed-off-by: Andrey Konovalov > > Andrey Konovalov (2): > kcov: collect coverage from interrupts > HID: usbhid: kcov: add annotations for coverage collection > > Documentation/dev-tools/kcov.rst | 16 +-- > drivers/hid/usbhid/hid-core.c | 25 +++- > drivers/hid/usbhid/usbkbd.c | 15 ++- > drivers/hid/usbhid/usbmouse.c | 7 +- > drivers/usb/gadget/udc/dummy_hcd.c | 1 + > include/linux/sched.h | 3 + > kernel/kcov.c | 196 +++++++++++++++++++---------- > lib/Kconfig.debug | 9 ++ > 8 files changed, 192 insertions(+), 80 deletions(-) > > -- > 2.24.1.735.g03f4e72817-goog >