Received: by mail.netbsd.org (Postfix, from userid 605) id 7AECD84F04; Sun, 6 Mar 2022 09:03:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id AE11D84EFE for ; Sun, 6 Mar 2022 09:03:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id YsBkOpTRkaDA for ; Sun, 6 Mar 2022 09:03:42 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 482BA84D22 for ; Sun, 6 Mar 2022 09:03:42 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 4569DFB24; Sun, 6 Mar 2022 09:03:42 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Sun, 6 Mar 2022 09:03:42 +0000 From: "Taylor R Campbell" Subject: CVS commit: src/sys/dev/usb To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20220306090342.4569DFB24@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Taylor R Campbell" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: riastradh Date: Sun Mar 6 09:03:42 UTC 2022 Modified Files: src/sys/dev/usb: usb.c Log Message: usb(4): Use atomics for usb_async_proc. This is written under proc_lock and read without it in usb_add_event, so using atomics pacifies the sanitizer. No memory ordering needed because the value isn't actually used until the softint runs, using it under proc_lock. Kind of a micro-optimization, but let's avoid contention on proc_lock in the common case of no usb_async_proc set up (why is this a system global, anyway? and why is there a softint if usb_add_event always runs at IPL_NONE?). Reported-by: syzbot+1b2fa68535e5b0f3dcaa@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.198 -r1.199 src/sys/dev/usb/usb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.