From patchwork Tue Jul 28 12:10:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11689057 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8323213B6 for ; Tue, 28 Jul 2020 12:11:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A0F920714 for ; Tue, 28 Jul 2020 12:11:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595938296; bh=z7k6UOCnAozQaZ5b9+HbexJNfnxw8lOBXCJ8+UaN1r8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KO6qp3cQcmiu/+KPQ8hw57Vk/Mhvms2oAfuVKl+ibU2DO27KYMVLuTl1dK7nfUlCv 6BGv13jmWZZnUU9tJa4kXaOi5ThLUpyovGDqBd+MOeAuJtLzcY8hD9KPMu+jJB7OOR oE1Ybd9Is+699LMaFhhYdlvgwAMHBkjuwTkXXs0g= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729174AbgG1MLf (ORCPT ); Tue, 28 Jul 2020 08:11:35 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43489 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728840AbgG1MLe (ORCPT ); Tue, 28 Jul 2020 08:11:34 -0400 Received: by mail-lj1-f196.google.com with SMTP id f5so20838297ljj.10; Tue, 28 Jul 2020 05:11:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hTBfJmBRO5Rb64D0GBJ0IiAqZ76bUdrzaMxwh1TXFb0=; b=SxtkdkwgMSjEAcuV1Dh1I50cvoCjAQVjCl6D++s/CsUzq8Z4qf+3NfcCl/eI1Q2m1G 4jGS6LQ9YBUvW2OAaqTPtO/usjPSpS/OjWpDEDlCohJMpIa4tJe0LUZT8caKFoQDWQ2Q YV1R1sFhQOUblymsyM2PMkXKHq+p7v2pmVOztJMqLrXHVv6DsI6W8sdlnAYkBpT0eagR BFRf2ebsn2E0SzKma0GRnsmXNnL6a5B0t9GRu8lTwpfWsjqAJMxy5R3ibXqa2xbvT1zh tWkSrI98H2j8w6c+UM7bb4ThimPM2+UoA8WqBoey6p5A3qfRKLR2Q9C1rYtqoKt/Ip/S nycg== X-Gm-Message-State: AOAM533WefW2+4CXk3+Lc3q0ZftEBgQWBk/KSAxMRZ31BSlhHtbmAE3d /71S/8HLtXmNfE+EY48ZP2vdBjQF X-Google-Smtp-Source: ABdhPJzC1SMcuOdVj/5aYJlv/u9WFtJAP1KL6sA78L8BZzYm79E/lc2vkanmCzzPMo2ko/B+G5/ZlQ== X-Received: by 2002:a05:651c:294:: with SMTP id b20mr5420677ljo.4.1595938291950; Tue, 28 Jul 2020 05:11:31 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id o16sm1728264ljc.66.2020.07.28.05.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 05:11:30 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1k0OS6-0003Dn-A8; Tue, 28 Jul 2020 14:11:26 +0200 From: Johan Hovold To: Woojung Huh Cc: Microchip Linux Driver Support , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , "Woojung . Huh @ microchip . com" Subject: [PATCH net 1/3] net: lan78xx: add missing endpoint sanity check Date: Tue, 28 Jul 2020 14:10:29 +0200 Message-Id: <20200728121031.12323-2-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728121031.12323-1-johan@kernel.org> References: <20200728121031.12323-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Add the missing endpoint sanity check to prevent a NULL-pointer dereference should a malicious device lack the expected endpoints. Note that the driver has a broken endpoint-lookup helper, lan78xx_get_endpoints(), which can end up accepting interfaces in an altsetting without endpoints as long as *some* altsetting has a bulk-in and a bulk-out endpoint. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Cc: Woojung.Huh@microchip.com Signed-off-by: Johan Hovold --- drivers/net/usb/lan78xx.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index eccbf4cd7149..d7162690e3f3 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3759,6 +3759,11 @@ static int lan78xx_probe(struct usb_interface *intf, netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); + if (intf->cur_altsetting->desc.bNumEndpoints < 3) { + ret = -ENODEV; + goto out3; + } + dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1; dev->ep_intr = (intf->cur_altsetting)->endpoint + 2; From patchwork Tue Jul 28 12:10:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11689061 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B59D613B6 for ; Tue, 28 Jul 2020 12:11:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9BEAC2070B for ; Tue, 28 Jul 2020 12:11:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595938316; bh=5FXUPD3uMaggwhRl/CQq0zBP266WPWdILicuQw/Htqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=C2J4FF6mzX5rGRxfPBY4FU4dSe9dOeoG7OvvcigTRY7m55PU39T6eWfciZHhzqEOl s6ByjC6w1o6zylxWkTfsBw/0Snu+oh1rOIQNgciL5cayTV/RGgj+9twFFi/AMenflc d4I672MZ1wf4j5klxv8MLsIurP+GGTyoJJ9K/3xo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729433AbgG1MLv (ORCPT ); Tue, 28 Jul 2020 08:11:51 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45998 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728896AbgG1MLf (ORCPT ); Tue, 28 Jul 2020 08:11:35 -0400 Received: by mail-lj1-f193.google.com with SMTP id r19so20819382ljn.12; Tue, 28 Jul 2020 05:11:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HZihSth8sxHseb5CAqThMzv8CFkUGVPv5HlzdDNm7OM=; b=GDqVYmqogkSDDTnW7Z/rcVxLVf3JdisDrRurzlb9Mz5g99op6ls+PFvEqGYF4t7GcG j+dYZJNyn4FN3+trOW8w1BVjL4bMAvmSWA/gEg2dgKzv17gA8x5ttSIuXl1hmeaEjUM4 pBhYNxMZHvj0OKu22Tl2tXRIN03GloifSaAtHebyQsmfMeWT+YKNzNMp7akA9UhvSdhv UT0zS0j4yGFu3VlUIjMLrUndeFE27fK9aUtBWZdEsGLosVqNaZJ87FEJse03I3EbtHb2 caGR5FAkusyyEUrxh1qbrDk8HJgT/lCRkyJlYQkORZpAN/FYjHQCPxiyGMg+vYRV/Pqs nQ7w== X-Gm-Message-State: AOAM533ffAb/ee3XL+UXPxcVDY5b083UrAshNGwDQJAvHa8gjbLYSeEt 0zgqKDAlGQMTH1ky9sU0+C8= X-Google-Smtp-Source: ABdhPJyrQt/ZrM783lj6kRb0W8svGfeXFa1wCBVVs2p98sADauOkMGa8ifznUUChWFLcrJmuV79hgA== X-Received: by 2002:a2e:9555:: with SMTP id t21mr12800427ljh.194.1595938292488; Tue, 28 Jul 2020 05:11:32 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id g19sm3749699lfd.28.2020.07.28.05.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 05:11:30 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1k0OS6-0003Ds-CH; Tue, 28 Jul 2020 14:11:26 +0200 From: Johan Hovold To: Woojung Huh Cc: Microchip Linux Driver Support , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , "Woojung . Huh @ microchip . com" Subject: [PATCH net 2/3] net: lan78xx: fix transfer-buffer memory leak Date: Tue, 28 Jul 2020 14:10:30 +0200 Message-Id: <20200728121031.12323-3-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728121031.12323-1-johan@kernel.org> References: <20200728121031.12323-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The interrupt URB transfer-buffer was never freed on disconnect or after probe errors. Fixes: 55d7de9de6c3 ("Microchip's LAN7800 family USB 2/3 to 10/100/1000 Ethernet device driver") Cc: Woojung.Huh@microchip.com Signed-off-by: Johan Hovold --- drivers/net/usb/lan78xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index d7162690e3f3..ee062b27cfa7 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3788,6 +3788,7 @@ static int lan78xx_probe(struct usb_interface *intf, usb_fill_int_urb(dev->urb_intr, dev->udev, dev->pipe_intr, buf, maxp, intr_complete, dev, period); + dev->urb_intr->transfer_flags |= URB_FREE_BUFFER; } } From patchwork Tue Jul 28 12:10:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 11689059 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9F7B13B6 for ; Tue, 28 Jul 2020 12:11:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9A292070B for ; Tue, 28 Jul 2020 12:11:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595938301; bh=pU8MUcoYV2cXwU3q9lEF0MJoiYrzCgumuupX5Sdl4E8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=vSRwBN6qJAhnfHADr2C2/k5BAcWhGoKG7ybROWprx9Klp1NFGI04YXRGLvd2e1st9 lBmbZnNeepegy4hQy7F3TsPgT6DhYYzgNI/wo/tAboHTRmVA741ahVqVkCWr2EiTug 5sJ2km0r72oAiVHkadHB2hJC84BDWpcx1hu/GBoQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729327AbgG1MLk (ORCPT ); Tue, 28 Jul 2020 08:11:40 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:46216 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbgG1MLf (ORCPT ); Tue, 28 Jul 2020 08:11:35 -0400 Received: by mail-lf1-f65.google.com with SMTP id i80so10854317lfi.13; Tue, 28 Jul 2020 05:11:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XfaoFQeDT9YRusOqXGtxXFyLqPpgWHyL5Hg1Y49medM=; b=H1nSy84+USqSXRADm5cUlRl2UCU8/xrtFHg0olIU2BeCBX75smcc5UH6XztR54QFdd yaoT+SQG3yQUhIp+DujU4jrQqSvIQ4NsWxG2M7lPWCuCEi7dAjGgZDxDfDvTDkmNyc4i XNNqPyalKSfrOrgBrkEJAP8Kw/9qYWrrciolWEGkpLSnU4He/FhdvakvuZ2a67ADxzAu vCLSnec0y8LADWUSOMwSgqsyEfEENKMNj/pxm4l5wFlRoPsGp7tkHAJXaLWBEG62+u60 jfk6n/zgTrZYaTeAu7EY8tP00Y5m+OowVX5jJbfm+2j2sLKfi6PJR64Hfa5qWvU3XdIV S9QA== X-Gm-Message-State: AOAM533xHgdqsnnNxhHkjXGA3QoM3vE1MJk/Y4MaxBhg+OTyyL1iVA5g sobskvKNeBwrIHQA8Hjli7U= X-Google-Smtp-Source: ABdhPJzuHSUFPp+H0bFaE2pdfSypeZV94zayFlixueTWeM/Qj7KGWqg9C1SAl0XLNXCRPrNMfX0u4Q== X-Received: by 2002:a19:e50:: with SMTP id 77mr9715495lfo.188.1595938292907; Tue, 28 Jul 2020 05:11:32 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id 11sm2931980lju.102.2020.07.28.05.11.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 05:11:31 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1k0OS6-0003Dx-ES; Tue, 28 Jul 2020 14:11:26 +0200 From: Johan Hovold To: Woojung Huh Cc: Microchip Linux Driver Support , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH net 3/3] net: lan78xx: replace bogus endpoint lookup Date: Tue, 28 Jul 2020 14:10:31 +0200 Message-Id: <20200728121031.12323-4-johan@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200728121031.12323-1-johan@kernel.org> References: <20200728121031.12323-1-johan@kernel.org> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Drop the bogus endpoint-lookup helper which could end up accepting interfaces based on endpoints belonging to unrelated altsettings. Note that the returned bulk pipes and interrupt endpoint descriptor were never actually used. Instead the bulk-endpoint numbers are hardcoded to 1 and 2 (matching the specification), while the interrupt- endpoint descriptor was assumed to be the third descriptor created by USB core. Try to bring some order to this by dropping the bogus lookup helper and adding the missing endpoint sanity checks while keeping the interrupt- descriptor assumption for now. Signed-off-by: Johan Hovold --- drivers/net/usb/lan78xx.c | 117 ++++++++++---------------------------- 1 file changed, 30 insertions(+), 87 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index ee062b27cfa7..442507f25aad 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -377,10 +377,6 @@ struct lan78xx_net { struct tasklet_struct bh; struct delayed_work wq; - struct usb_host_endpoint *ep_blkin; - struct usb_host_endpoint *ep_blkout; - struct usb_host_endpoint *ep_intr; - int msg_enable; struct urb *urb_intr; @@ -2860,78 +2856,12 @@ lan78xx_start_xmit(struct sk_buff *skb, struct net_device *net) return NETDEV_TX_OK; } -static int -lan78xx_get_endpoints(struct lan78xx_net *dev, struct usb_interface *intf) -{ - int tmp; - struct usb_host_interface *alt = NULL; - struct usb_host_endpoint *in = NULL, *out = NULL; - struct usb_host_endpoint *status = NULL; - - for (tmp = 0; tmp < intf->num_altsetting; tmp++) { - unsigned ep; - - in = NULL; - out = NULL; - status = NULL; - alt = intf->altsetting + tmp; - - for (ep = 0; ep < alt->desc.bNumEndpoints; ep++) { - struct usb_host_endpoint *e; - int intr = 0; - - e = alt->endpoint + ep; - switch (e->desc.bmAttributes) { - case USB_ENDPOINT_XFER_INT: - if (!usb_endpoint_dir_in(&e->desc)) - continue; - intr = 1; - /* FALLTHROUGH */ - case USB_ENDPOINT_XFER_BULK: - break; - default: - continue; - } - if (usb_endpoint_dir_in(&e->desc)) { - if (!intr && !in) - in = e; - else if (intr && !status) - status = e; - } else { - if (!out) - out = e; - } - } - if (in && out) - break; - } - if (!alt || !in || !out) - return -EINVAL; - - dev->pipe_in = usb_rcvbulkpipe(dev->udev, - in->desc.bEndpointAddress & - USB_ENDPOINT_NUMBER_MASK); - dev->pipe_out = usb_sndbulkpipe(dev->udev, - out->desc.bEndpointAddress & - USB_ENDPOINT_NUMBER_MASK); - dev->ep_intr = status; - - return 0; -} - static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) { struct lan78xx_priv *pdata = NULL; int ret; int i; - ret = lan78xx_get_endpoints(dev, intf); - if (ret) { - netdev_warn(dev->net, "lan78xx_get_endpoints failed: %d\n", - ret); - return ret; - } - dev->data[0] = (unsigned long)kzalloc(sizeof(*pdata), GFP_KERNEL); pdata = (struct lan78xx_priv *)(dev->data[0]); @@ -3700,6 +3630,7 @@ static void lan78xx_stat_monitor(struct timer_list *t) static int lan78xx_probe(struct usb_interface *intf, const struct usb_device_id *id) { + struct usb_host_endpoint *ep_blkin, *ep_blkout, *ep_intr; struct lan78xx_net *dev; struct net_device *netdev; struct usb_device *udev; @@ -3748,6 +3679,34 @@ static int lan78xx_probe(struct usb_interface *intf, mutex_init(&dev->stats.access_lock); + if (intf->cur_altsetting->desc.bNumEndpoints < 3) { + ret = -ENODEV; + goto out2; + } + + dev->pipe_in = usb_rcvbulkpipe(udev, BULK_IN_PIPE); + ep_blkin = usb_pipe_endpoint(udev, dev->pipe_in); + if (!ep_blkin || !usb_endpoint_is_bulk_in(&ep_blkin->desc)) { + ret = -ENODEV; + goto out2; + } + + dev->pipe_out = usb_sndbulkpipe(udev, BULK_OUT_PIPE); + ep_blkout = usb_pipe_endpoint(udev, dev->pipe_out); + if (!ep_blkout || !usb_endpoint_is_bulk_out(&ep_blkout->desc)) { + ret = -ENODEV; + goto out2; + } + + ep_intr = &intf->cur_altsetting->endpoint[2]; + if (!usb_endpoint_is_int_in(&ep_intr->desc)) { + ret = -ENODEV; + goto out2; + } + + dev->pipe_intr = usb_rcvintpipe(dev->udev, + usb_endpoint_num(&ep_intr->desc)); + ret = lan78xx_bind(dev, intf); if (ret < 0) goto out2; @@ -3759,23 +3718,7 @@ static int lan78xx_probe(struct usb_interface *intf, netdev->max_mtu = MAX_SINGLE_PACKET_SIZE; netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER); - if (intf->cur_altsetting->desc.bNumEndpoints < 3) { - ret = -ENODEV; - goto out3; - } - - dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0; - dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1; - dev->ep_intr = (intf->cur_altsetting)->endpoint + 2; - - dev->pipe_in = usb_rcvbulkpipe(udev, BULK_IN_PIPE); - dev->pipe_out = usb_sndbulkpipe(udev, BULK_OUT_PIPE); - - dev->pipe_intr = usb_rcvintpipe(dev->udev, - dev->ep_intr->desc.bEndpointAddress & - USB_ENDPOINT_NUMBER_MASK); - period = dev->ep_intr->desc.bInterval; - + period = ep_intr->desc.bInterval; maxp = usb_maxpacket(dev->udev, dev->pipe_intr, 0); buf = kmalloc(maxp, GFP_KERNEL); if (buf) {