Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp276226ima; Tue, 5 Feb 2019 23:08:28 -0800 (PST) X-Google-Smtp-Source: AHgI3IaxIpBSk+qO7jEMIrFYHUTlAHIcJfJdrSIpUC1ecCHUIp3w+CPk+mcql6Y2eTr5Dw38/HAE X-Received: by 2002:a17:902:6b49:: with SMTP id g9mr9154721plt.98.1549436908010; Tue, 05 Feb 2019 23:08:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549436908; cv=none; d=google.com; s=arc-20160816; b=H0+GtCBlK2XFrLH24h2AZHKdU4bgFu7xWFY230uBcRjj+VctPyia4h+Q0yWXeNCMsf zwHTQ73yXfPS5jdRCjNiTSNcCO0cXpogG6dZdsAEIFuLsI2/9HIwEg75G+QYMG9DpVbu 3K7juPfVd/wOgYV4aznk+VYff1RQF9ll9BQmZw/6V3NeCIIhryosZDlRuXwxO3I1L2ME kqST8pMXI3WME0d/kbhyaHvCKxMGxQsyJfaIg5r8rNRVbzJzCfS0YJCGJ/HxcIwMmrM+ 3ckFNrGZkZsQ1vTzWhUpIIhnE6VPOilr/p4ygKV+fWziV6xrPFV0UXkP91cpRQrt6mM3 ZOeQ== 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; bh=guOHj8QormagJdIx5ER1buHPXHqpkaP4abDJWq0keyY=; b=0676TQB8mLGFh5ApdjDaTiepHEj6ke8ZaZZW/jwCq7EeT6ay59x7laKA41d7rURgPj fguc1kXGN+RDTMPwtASEUDkcLuZxCSl5GSLSi2hAGLDdUpYaOKuub9uxBdyWxogUxDRT NH8YU82U3bdw76xpZIgC3tJcv+rxrqxiAI3hRbOTa5/xPNEFIfRoSFAo/DOxcTmiKskE 1B5nE/GLO6nDTSzkLyZqP+gv6AQjyCvt5y872AzWHI5idl0trgPguyMRN/sX+BVUp8FC 2h3vfvIlK2c8BNAi0ndc49a0w7SZKk3/rtpFkFs6P+rEn5oStkJWjsz1o4I7TvxnjkA7 gDIg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g98si5565871plb.99.2019.02.05.23.08.12; Tue, 05 Feb 2019 23:08:27 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727732AbfBFHG5 convert rfc822-to-8bit (ORCPT + 99 others); Wed, 6 Feb 2019 02:06:57 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:45660 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725897AbfBFHG4 (ORCPT ); Wed, 6 Feb 2019 02:06:56 -0500 Received: from marcel-macpro.fritz.box (p4FF9FD60.dip0.t-ipconnect.de [79.249.253.96]) by mail.holtmann.org (Postfix) with ESMTPSA id 2900DCF2A4; Wed, 6 Feb 2019 08:14:45 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH v3 0/2] Bluetooth: Add NULL check for tiocmget() and tiocmset() From: Marcel Holtmann In-Reply-To: <20190206063533.GA7402@myunghoj-Precision-5530> Date: Wed, 6 Feb 2019 08:06:54 +0100 Cc: Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <0D421861-FCD6-4AFF-8A0F-DBEE520DB64B@holtmann.org> <20190206063533.GA7402@myunghoj-Precision-5530> To: Myungho Jung X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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