Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp279045imm; Thu, 26 Jul 2018 19:01:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdkoyPpKEhlkK4oIcI7kmyg5lUdYXm4C5bKy5bsNroCne7Kfr+CoqGsUpJuocd+IJDj9eW3 X-Received: by 2002:a17:902:6bc8:: with SMTP id m8-v6mr4196917plt.162.1532656902980; Thu, 26 Jul 2018 19:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532656902; cv=none; d=google.com; s=arc-20160816; b=B6NZKokyHgkv8NbIdm+bp/W5t+ch2eBQRrA0VNOzR+U+MzWl2QzaXtv7JHY5ALkeat 92H1xN4sdwu4phzddM1N24ASxj1BRBucMTlKfxv3eozyxaNn/9HuPd93Yhh9KpS+HIsK f66e7tzehajgWZZgaMLnQ88hgmW5qR0u8pjhwe+n6PHTQePd59vGk53ZBaeL3nWMLi9E gc4yAFev3dDU/HezGF/OB9eOoz/Yxg/gu0DsIr32ICLu9pd4BxVQm26wnzCNwCUIfvk/ uCnW5AMAlGjyTDndU1mLu12TB4boqFha6R291JSrZxKbVUQr1LP3ldh0ZMCREA9WO2Hw 003w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=6+rxktQ0QiQizABkCvSDIAhiOxxb4YXLK1mpwqKGkn0=; b=XAQbHHJcHzIGJFjsZQo9L71BokyyovWouXlljbzRDttMty2npcVlPbL+UTsTux5OlS OPULamR4uA9gvZMNTr2zAqBxRPPMPOh4d5mPeZW4D/4eirltqOnt/+S7SeBJodG/ZKqD hQ+Ra3SlON2xld14lOvlfN36O85jwl87mdNkjbe8CBBgRkLSujSM6yd5rZ/FBvQf3NOk C4mkUJBJ0NZCNFnv9YwxSfByqr/eUBe8UuYc93wzM76l9xK4Sl8uZNUDihHKZMmqnopo 4pexdm1C5zSjpHDbl8lsD7nYwMk5H6dVWM/FWcBNu0Nk9dwWFoxnNyiavxvjGktqIFUC U1ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=irZ2W0Sk; 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 w65-v6si2610516pgb.377.2018.07.26.19.01.27; Thu, 26 Jul 2018 19:01:42 -0700 (PDT) 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=irZ2W0Sk; 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 S1732077AbeG0DUG (ORCPT + 99 others); Thu, 26 Jul 2018 23:20:06 -0400 Received: from mail-pg1-f174.google.com ([209.85.215.174]:46294 "EHLO mail-pg1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732000AbeG0DUG (ORCPT ); Thu, 26 Jul 2018 23:20:06 -0400 Received: by mail-pg1-f174.google.com with SMTP id p23-v6so2255719pgv.13; Thu, 26 Jul 2018 19:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=6+rxktQ0QiQizABkCvSDIAhiOxxb4YXLK1mpwqKGkn0=; b=irZ2W0SkFWxZWaVJQngwohrmU9q9V4lTsg6iOmqYH4HIcvV4zy9JpuNRoktO3taAwR 907pte2HhFFvP627sBy5pfBits0ODi37yDkGHsE+Buj4pHtDqrTqaVd5fyomvnAStVJg FatMXNLWCmGNLBx3jhFOoRUc01aK8yn8/sS2cyi1BUd2nDc7wTxoHFqrGvjC0+eFKlJk oM163ze9fevbQAcGp+xaT+kfITocbOPlNw+ihfDVkwWn+2QnLra6SwIDilUi8Uua8d/P es4OY5YEDmn+GllMnaXhY9zhKsV1rM1sp+EVB+o1XSnZRovnkEHtkPFq+8HAEOp+v9hS J7LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=6+rxktQ0QiQizABkCvSDIAhiOxxb4YXLK1mpwqKGkn0=; b=U1Ybn8kLV299J1fqmSFPOJVem0+W7zII0Dlec10TDR/WX/P5G4mHcc2H4Y58Plgbzg nOJHqE4K55oT/nXDWExF51aReluAzIBpA2nDiZSPscCGDAS+kfBIwhq/3A89JHe3Iv1Q rkGEtizyD9DwqYJTh5F0Y9/WR57yxTiPRBEjO4M2X58ltNpa9wkCMHo0jCo11gG+TOBM gtqpMSUXRkAEftNEGC/1THEoKa6m2Pnpsvdp2Oc3X6cNiu+RengwaE7EkGkU8AAB1wMi wPbIue+aXZH0/esuN/uB9FQ03IEljA/YiuEuTK9bAoE9P7EoQ2IE+QUS/n0sFyVm+t9Y /rUw== X-Gm-Message-State: AOUpUlHolm3bLoOR42Eg/9bmRAcCSp6BH2zp6JTUUdIWuRZnywww2rfS /sLsMiIyJ6ew5Dr/Nim1K5E= X-Received: by 2002:a62:9f85:: with SMTP id v5-v6mr4515611pfk.27.1532656836367; Thu, 26 Jul 2018 19:00:36 -0700 (PDT) Received: from [192.168.3.4] (softbank219203027033.bbtec.net. [219.203.27.33]) by smtp.gmail.com with ESMTPSA id y3-v6sm8570217pfi.24.2018.07.26.19.00.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 19:00:35 -0700 (PDT) Subject: Re: media: dvb-usb-v2/gl861: ensure USB message buffers DMA'able To: Mauro Carvalho Chehab Cc: Colin Ian King , linux-media@vger.kernel.org, Antti Palosaari , "linux-kernel@vger.kernel.org" , mika.batsman@gmail.com References: <8308d9f0-2257-101c-69e3-8fe165de9348@canonical.com> <20180725105701.4f3b429b@coco.lan> From: Akihiro TSUKADA Message-ID: <75be710b-3eda-e077-7c90-beec059d83b2@gmail.com> Date: Fri, 27 Jul 2018 11:00:25 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180725105701.4f3b429b@coco.lan> Content-Type: text/plain; charset=iso-2022-jp Content-Language: en-US-large Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 2018年07月25日 22:57, Mauro Carvalho Chehab wrote: ... > There was another patch proposed to fix this issue with does the > right thing when rlen == 0. I rebased it on the top of the current > tree: > https://git.linuxtv.org/media_tree.git/commit/?id=0b666e1c8120c0b17a8a68aaed58e22011f06ab3 > > That should cover both cases. When wlen is checked to be <= 2 and wbuf[0],wbuf[1] are already used in 'index','value', why this patch copys wbuf and passes it again in usb_control_msg when wo==1 ? (just to silence static analiyzers?) Furthermore, I am afraid that a static analyzer might warn on a possible buffer overrun in usb_control_msg in the case of rbuf == NULL && rlen > 2, since buf's length is passed as rlen but is actually wlen. regards, Akihiro