Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3802883imm; Mon, 2 Jul 2018 05:59:46 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfrAHBkOWe585y2pIFGi5ywCeW5LI+//YNa46j3XvdUtrdzOz8m3z2ZiFpc2JiD0PF9YWv4 X-Received: by 2002:a62:e0d5:: with SMTP id d82-v6mr8300885pfm.59.1530536386548; Mon, 02 Jul 2018 05:59:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530536386; cv=none; d=google.com; s=arc-20160816; b=CqaUvMm0EPNh9hpmd/8qlLkduZYXv9oYPnV2/Y2+gqfS6RiQvNMI3EII2EeQ5QssUE RhjTTI71LRfsFTK3wi0R7r/uA2znHeTgks+uuPJDf8gbLUhkEh1qnpplyqMG9fi2/46m NPeV6H0eKid8CdtmpeuumFu4YCxizss9Jzav5FWRKaR//WoZE3dRNCbgDS8iwTvo1gcW o4mEF5C3stw9OsKl1LVB4aQnVuYHHI/b6a+6ocMht/IxSHdAA7KO5XpN7LGzh5iqdaEq 53MoGNZ+hwAnMqFah8IDH/f9DZ70MsLutLHJjCE2hQ5r3Hs2Arbw70PKg7kPBzVLgxSG SxPg== 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:mime-version:user-agent:date:message-id:subject:cc :autocrypt:openpgp:from:to:arc-authentication-results; bh=cmWE10rWVyOUGzSsCY9feq42oExlFlyAfTDrqcd+ipM=; b=U10sE3ER46hedETakvMVOPHGV9+/zQOjVeBccC6Gnf3/TrMZ9asrbdR0zjqEZxeimk OqOjqBOx3fIcuKxpAsT1CJtbWnQKwlePXcKswLQLC+h4NanHJW8ijkfha6zlCDT9LIle Fui3DsB64YJu8ZhPFjRMABHQ2Pg4WOid8bJCyeVpRSXYxT+pgLW3w6dVzOSddqQfRADX EMf5WOuASFaMSXDDgFBYl+W92kQvpatiuwvy4nm12LLY0FY1onyDxaUhYXl9jwzdqQtX DdS96vg/JBzRrt0wq5hVOjPnLrzT7pwplYz3zGxesLFhuSs6lQfQ0+xgj3EFxCgVRKIl ViaQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39-v6si15933815pld.83.2018.07.02.05.59.32; Mon, 02 Jul 2018 05:59:46 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752292AbeGBM64 (ORCPT + 99 others); Mon, 2 Jul 2018 08:58:56 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:58572 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbeGBM6x (ORCPT ); Mon, 2 Jul 2018 08:58:53 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fZyPr-0006hz-2d; Mon, 02 Jul 2018 12:58:51 +0000 To: Akihiro Tsukada , Mauro Carvalho Chehab , linux-media@vger.kernel.org, Antti Palosaari From: Colin Ian King Openpgp: preference=signencrypt Autocrypt: addr=colin.king@canonical.com; prefer-encrypt=mutual; keydata= xsFNBE6TJCgBEACo6nMNvy06zNKj5tiwDs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QABwsFfBBgBCAAJBQJO kyQoAhsMAAoJEGjCh9/GqAImeJYP/jdppMeb7AZnLGVXd8rN7CLBtfMOkXCWaOUhjMRAY7dV IMiF1iPZc6SgiiMSsdG7JJhMjMuLTxA0kX2Z6P0+6dZlO4bDOKMIv4nNGhgSj9NuSKJPRiyi XKKD/wNnPXVFdBZsoHnEXGyAFGnidu4KLUJIiSm4tHJdoMk0ZaJSmwt0dtytuC1IWH8eIaVo /Ah6FxCaznRzvGNFx+9Ofcc7+aMZ15dkg9XagOuiDZ1/r6VuEw9ovnkDT4H5BAsysxo/qykX 4XQ2RQSY/P3td9WNLeXLvt1aJNRcwcIEKgZ5AO3YQbEJt1dEfCU7TAKiRpsjnC/iQiQHGt2I vNci8oZmM3EQEi7yZqD07A6dpGTnRq9OQ7fGhj0SS99yZvooH3fBIHA2LRuvhfDAgTrpbU0w LvkAIo0T2b9SoRCV8FEpHvR2b86NbTU5WN4eqZQbAbnxC7tJp6kLx2Zn2uQMvfXRfnS9R1ja etvpk3h7F+r/RAAh+EvgsPUNaiRJRRLvf9bxTQZhmNrw79eIFNsRIktniLyomJf2+WPOUECz h1lfLqe9yiuUKv+m5uAalXdayhiPbp/JHs1EDRgSq3tiirOsKrh/KMpwz/22qGMRBjFwYBhf 6ozgujmPlO5DVFtzfwOydzNlXTky7t4VU8yTGXZTJprIO+Gs72Q1e+XVIoKl3MIx Cc: "linux-kernel@vger.kernel.org" Subject: re: media: dvb-usb-v2/gl861: ensure USB message buffers DMA'able Message-ID: <8308d9f0-2257-101c-69e3-8fe165de9348@canonical.com> Date: Mon, 2 Jul 2018 13:58:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, While running static analysis on linux-next with CoverityScan an issue was detected with recent commit: commit 86f65c218123c4e36fd855fbbc38147ffaf29974 Author: Akihiro Tsukada Date: Sun Apr 8 13:21:38 2018 -0400 media: dvb-usb-v2/gl861: ensure USB message buffers DMA'able The report is as follows: 46 } assign_zero: Assigning: buf = NULL. 47 buf = NULL; Condition rlen > 0, taking false branch. 48 if (rlen > 0) { 49 buf = kmalloc(rlen, GFP_KERNEL); 50 if (!buf) 51 return -ENOMEM; 52 } 53 usleep_range(1000, 2000); /* avoid I2C errors */ 54 CID 1470241 (#1 of 1): Explicit null dereferenced (FORWARD_NULL). var_deref_model: Passing null pointer buf to usb_control_msg, which dereferences it. 55 ret = usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0), req, type, 56 value, index, buf, rlen, 2000); The assignment of buf = NULL means a null buffer is passed down the usb control message stack until it eventually gets dereferenced. This only occurs when rlen <= 0. I was unsure how to fix this for the case when rlen <= 0, so I am flagging this up as an issue that needs fixing. Regards, Colin