Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp642545imj; Thu, 7 Feb 2019 09:34:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IZhkCi6FZg7rQw5Re/u8HnbS8ua5vW6Ed8ts15o7CQF1rHACH/aG/7C2TiktY9YSbcEhEuF X-Received: by 2002:a62:1e87:: with SMTP id e129mr17106324pfe.221.1549560884193; Thu, 07 Feb 2019 09:34:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549560884; cv=none; d=google.com; s=arc-20160816; b=ICanqBkxvm2g4qz58z5/9cBbGV4qCgURwQhxu8tKhiz/+RkXnpCIEBeeLtscP69dm2 F95Z2b59WrZ7xerXfMffcYdR5+uILxBhqHCVQqlq9PW1LoOllIX5WZek7Jq0qWnj5jei IBsSFLbSWanyfsvXIk4HpgV6AC+16Yj5P1Z3XmFBqo8dEwu7qN3NOIomiCVNIeUl1qmR tZfCyeyDhJJ4mQY6Yyyk/oKgI9HvJ6nRHE4QPwU2RUBJ2W83ZerLDeAZuH4JNBZQf1ff gzAyqSaKoH7/NeP8E60xCBgBAyd2T3EH+tf2s3Uc9idPaZ0RiSrdByxkDuhWVzHhIxqQ FKfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PCYhZyNInpjLjW+q/t1SME/ASaPkda8cIIIuXHBmTU8=; b=TmHycyCCy8e4G9MJmVntpn+Bn6S/H3JVqViZDBkT2VKCeW0I40GmHk9/myP3tBvMep pK4/A0t342ociJtrmw/Anhgph8v8S1BT0Ha61cSd2dOkwXLVsUmaXILoRXzPOjoD8NTi XsVNNdvLyiVeSwoymJdnCxZxSzxhs206ey/guHU6slW74VUcudIU4WkcJEIYqgySfpQN XzHNt/KdCafexLZTtQ7yusmjiDre2c8U2d4Y0lJhkIB5Tru/J1KAOFeOgLmcwHidvFdl cNWQYoXa+2ySYnqAh5NhbqPEkQ4PiIJXAdJeIQ4o3kO5J1iREc+xyqkCNERHDjCyC1Ab +lDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eRbXSN19; 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=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 b1si9778912plc.332.2019.02.07.09.34.28; Thu, 07 Feb 2019 09:34:44 -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=@gmail.com header.s=20161025 header.b=eRbXSN19; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbfBGReN (ORCPT + 99 others); Thu, 7 Feb 2019 12:34:13 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:32920 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726873AbfBGReM (ORCPT ); Thu, 7 Feb 2019 12:34:12 -0500 Received: by mail-pl1-f194.google.com with SMTP id z8so258079plo.0; Thu, 07 Feb 2019 09:34:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=PCYhZyNInpjLjW+q/t1SME/ASaPkda8cIIIuXHBmTU8=; b=eRbXSN19cx98TfnL4TmLQemVkDnp2Yu8dCaoXDVqAtlwmnRFAuN5Hdzi4X8Yi3nTr5 HYqpgZdYvVrnoA/nqG/hCaqGEWbw8oi8l9DYONET8CBZrZeOMyRMJp5rv9KZrNtRJoow gc/Y1tP4hv5gb3ywBo4BFbqM8YOjVyssdG1b0eHcSkh4vOkQ86yy/vnN3EqCu8ztYIrZ airIzMGppyOjXoeHZxYHWaXrrNQ7ZWzwt3KAV7or8RbPnP03TuohHMVDm1+ILqzuB4My tYXgSzvJ4gaWrVH8K0+OBzqMz9aRFMpC7Ehw65Z0zAtFBI7RfIcRdx5tmjuRCtKaZ34e hzUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=PCYhZyNInpjLjW+q/t1SME/ASaPkda8cIIIuXHBmTU8=; b=j+zBal/b+jy8bRBXVVsY7XGMRMlh4OpRAc5paX8LM6+gA09oP8vXvrO483tbvWbukV 5XfcSMPU2cTAne2DuuapJZxsQIQKVwJtHgAk260luiSpDKk2TtE5GcdtQxlcINufCmcZ JWIQ1Y5qqn06vK1wkxk4ODJSCpYBsAxrDVawr3mTdPMsTIhFbpbXHztsKg+FvWBkkGB2 vZfkhbwK8xdUmbkN9s4vqKGOyV1gQ+UfwFUCrHtlIqVVe093mDtdzQVmhO5Kpnemqfzd FgCbb/9795BZdetvKzRXV9tyY1z5MbG1lxJMGo6WMN1hcp5p2MT4pQGX+m3KRr9hDiV/ Qd7Q== X-Gm-Message-State: AHQUAuZOorY+rgCH+KZSVp2KYLLYamceI8VWRppKptNyYYLX2NB4fif/ E5AeqyeajARhConsyuJSxts= X-Received: by 2002:a17:902:b60e:: with SMTP id b14mr17131793pls.301.1549560852023; Thu, 07 Feb 2019 09:34:12 -0800 (PST) Received: from myunghoj-Precision-5530 (cpe-76-176-3-80.san.res.rr.com. [76.176.3.80]) by smtp.gmail.com with ESMTPSA id e16sm12034426pfn.46.2019.02.07.09.34.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 09:34:11 -0800 (PST) Date: Thu, 7 Feb 2019 09:34:07 -0800 From: Myungho Jung To: Marcel Holtmann Cc: Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 0/2] Bluetooth: Add NULL check for tiocmget() and tiocmset() Message-ID: <20190207173406.GA32315@myunghoj-Precision-5530> References: <0D421861-FCD6-4AFF-8A0F-DBEE520DB64B@holtmann.org> <20190206063533.GA7402@myunghoj-Precision-5530> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 06, 2019 at 08:06:54AM +0100, Marcel Holtmann wrote: > Hi Myungho, > > >>> tiocmget() and tiocmset() operations are optional and some tty drivers > >>> like pty miss the operations. Add NULL checks to prevent from > >>> dereference. > >>> > >>> Myungho Jung (2): > >>> Bluetooth: hci_ath: Add NULL check for tiocmget() and tiocmset() in > >>> ath_setup() > >>> Bluetooth: hci_ldisc: Add NULL check for tiocmget() and tiocmset() in > >>> hci_uart_set_flow_control() > >>> > >>> drivers/bluetooth/hci_ath.c | 6 ++++++ > >>> drivers/bluetooth/hci_ldisc.c | 4 ++++ > >>> 2 files changed, 10 insertions(+) > >> > >> why are we not enforcing the availability of these in the hci_uart_tty_open? > > > > Are the operations required on any HCI UART drivers? For now, I found only 5 > > drivers (ath, bcm, intel, mrvl, and qca) are explicitly calling them. So, I'm > > not sure whether it breaks any existing code with other drivers if returning > > error in open(). > > the H:4 spec requires setting flow control. In some cases this is done by the hciattach or btattach utility, but it still means that it is required. So failing on TTYs that don’t support it is just fine. > > Regards > > Marcel > Ok, let me make a change on hci_uart_tty_open(). Thanks, Myungho