Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1095485ybf; Sun, 1 Mar 2020 00:38:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwpyDBVLqHd7yhOpm3Q2xClBfsKgX4j5YIaZsOxKvLvJFoD6+9LM9XO0OE1THb7EA8M9yhE X-Received: by 2002:aca:1012:: with SMTP id 18mr7908649oiq.151.1583051939685; Sun, 01 Mar 2020 00:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583051939; cv=none; d=google.com; s=arc-20160816; b=LtAlmBt96PEH2R6xS52uZEcEEMbBj/iQi3l5b1Onjujtijp9Pvd3dNWh+eEWR0+KtA divj4sNPqCmlE4YEz9p4dQ5PkHk6HJ8wA9OpaRNqFgCRkZ8AJQdQGlIPr1V/9JH4sB7F Vvz8WApEPW3sYq3WN+sCYF4NxMW5MdcNlrrpn4VrsZL8ysu+2j3FuXYckVnSoy64Xpk9 NvTYlnELHuM/Fe+woyK9hp64B2yGgFG1ULictfMElE7xvDtaReEZWzWFlXqzXZ9nSRLD ppQywba7sIYdLipYtVD/NMKTsfOobrsooXlqx+eA+RtfJyI/Q03Gyn1fM/q3yoyFxzul AUaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=j7Icc8H9OXIphKDSZkaFmOOa+8mh1h1QtKYjalo4FjU=; b=YqonvTLm8h8J63VeywDzRQT9zYXlX9Ft3GgqMSf+Kh4wSYo5dpWObC4bh/t4VZLYUC R+EMmkXJ2Jh2XtjHEVYqNJOjS2qxGlRNv9EdZIgV2+54AKON/hocRxguOFmZWvbmn9uw rXaDQ6deMbDORLkVKaFaUEHV66kq2nw/s/OhkHpphSZ0NT5LKnflIj6qSeufiMD9iffS jcKh2uryRXfNbv472L68+ENWqu0jN4UWQAlteGV2DdTS1gBZa4p5z6wBmg4MJZuDJSaj RLkZg+BpAO7xw1ifISUfaldVIu9eU6ikimuAptsh/uqcqeQ551dyh6O8OilQp5C8cMsn qqsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZOs+3+Mk; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9si4848260oti.44.2020.03.01.00.38.30; Sun, 01 Mar 2020 00:38:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-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=@gmail.com header.s=20161025 header.b=ZOs+3+Mk; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725874AbgCAIi0 (ORCPT + 99 others); Sun, 1 Mar 2020 03:38:26 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40112 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbgCAIi0 (ORCPT ); Sun, 1 Mar 2020 03:38:26 -0500 Received: by mail-pg1-f195.google.com with SMTP id t24so3833148pgj.7 for ; Sun, 01 Mar 2020 00:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=j7Icc8H9OXIphKDSZkaFmOOa+8mh1h1QtKYjalo4FjU=; b=ZOs+3+MkXYMpGjKMeuiy6fEGYW66CIRrndJBPokf4m0fm2ap96cCcnSgjYMmmHeuiC B7Z/kWR0EfRMMW/NJ9mc5++CPcZbqUau6wtWpzLH5L/X7Dc4lq365e3sTpck7aLjbRzZ cEyFbxJHPK9n7ialr3DNnh672sdjyOhlz3IZSqNdQj8eeRpSZibZienjud1i3H0a3tlO HxCr3TIGFWHglSMIlKB/ilj7B3+lDx1evWnxjA5C6fzdErnUPK1nwd+O7srw+X7Tc1GN ze7t0qgMhkhUzV0BXyfT0ZaK/T+Aa+wAxFcpnX6IXEQKriDUyUBETYEonZs9ulmIahUT 9W8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=j7Icc8H9OXIphKDSZkaFmOOa+8mh1h1QtKYjalo4FjU=; b=fPywHU9ZqpprhJyOC76b+WhCsC3K/dRgFVlmL6+4S8c9lHDikeXZGWRTQ+SusCWXmN eiFOIAuBN5rJouX+ECOk6PdCdwS7cyCnktyQP0ZxJm7queUIBONdlOoFlqTXmAvLQLfC G0Y8FPLERRc8PrX37u5o7+LBPnQNqapopttJhpoTV8CGV43iq6lc9CmMHTjMWf1KPR+m iyt/XtrcnWEVSH8i23/UheMA3E7gKpQnmwihnjeQwEFSaC8goc4GF23Z1dtq6ByCa5xK Ne6TzNnogyzFGsqUqWbabjcY9wv7reszStgOrLS6saSzWxLuTBrELo56gO6JWy/s8Zsi hBFg== X-Gm-Message-State: APjAAAVIxHn7aF1e01Jhf1sKyIjtNrOsowjizuQ9OG0VUnxWBM/ThSIg K1YUglBQ/AOx9/oF9Oe2bJ0R7Y1vlC71rA== X-Received: by 2002:a63:d0b:: with SMTP id c11mr12950911pgl.296.1583051905148; Sun, 01 Mar 2020 00:38:25 -0800 (PST) Received: from agalan1-mobl.ger.corp.intel.com ([192.55.55.45]) by smtp.gmail.com with ESMTPSA id a9sm16447929pfo.35.2020.03.01.00.38.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Mar 2020 00:38:24 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [PATCH v1] bluetooth: guard against controllers sending zero'd events From: Johan Hedberg In-Reply-To: <14FD24FA-1455-4FE4-832B-9851D9E22780@holtmann.org> Date: Sun, 1 Mar 2020 10:38:20 +0200 Cc: Alain Michaud , linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <20200228205146.161229-1-alainm@chromium.org> <788439D3-E0CC-4CBA-99C2-0B9C3703B23D@holtmann.org> <14FD24FA-1455-4FE4-832B-9851D9E22780@holtmann.org> To: Marcel Holtmann X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, On 1. Mar 2020, at 4.44, Marcel Holtmann wrote: >>> Why are you bothering to check for event here. Do we have requests = set with hci_req.event =3D=3D 0? >>=20 >> If I remember right, most requests are like that. req.event is only = used then the request completes in something else than a command = complete/status. >=20 > so what do we do then if we get an event =3D=3D 0 from the controller? = Just bail out early? It seems kind pointless to keep processing it. Yeah, that=E2=80=99s what I=E2=80=99d do. Bail out early, but log a = warning. Johan=