Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2879106imu; Sun, 6 Jan 2019 12:18:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Vw7GEQLgEGKkC9DTYKzcHsls/Wcao0MyweRzaY7jqjMw3WwG4E7MiYgeaK187Z/SFtV7Q X-Received: by 2002:a17:902:f24:: with SMTP id 33mr59411466ply.65.1546805900091; Sun, 06 Jan 2019 12:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546805900; cv=none; d=google.com; s=arc-20160816; b=tx4g5t5XkaIY/8nSwyBxmN0KagSiHvJ1eomceV3mED02/0PQ4dspiMTsDhXa01F7M9 elL+ui5dcyzOFnPnIaJ+p54FsaJ++xorI2yyX04+Gl9Zyn5bCOMJ+IRolHFkv/GsVV+e BsMLITpMmNN1tLhY5cqCmHezuyvhISyYnO5zh0TICFAi0+yoPJhe7Y3TxbFDWhloR5r+ V9FjWiUNMte55k4yvOtN4J/AcBzOjX2vA+xujyiAS2k8kei+WbPGqgNW0GGaNiQiF+bz LGhSo3mIuAwJNfSbtCfMZBUeG0j9ppG4MjY0DaBOjMXIf8gAeMXjvb/kbw3HfuuFtWZC HdNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=sauq8Ak0NA/hu0r68YByY7HAbkG0FNhLK81Z2GphIBk=; b=PNM8Vp0IncxPBQ3UCFIZgENojqzhvJbscM02AkuPBKST+rK+dITcsKYuIfpfXAQFd/ Q9mBXuRFJTpCRAHTJt101IfkDY7dHGqkZvjaMRhmQqvoVtO08XnIJ0NY279YjZW+bNri b/jdBZXIp/ifj+QRD5vAy0V4vZV5FltXMbiCcmpB3wVgJapDBgAuqelU6FQwDvHGNnEa wrBeiaqrsXTKYySJQw4pdZjxsLlQj+RR/LjHuuIic+kg/FvYMj87Xna2N4TJlHIM2LeW ztfu4GmW7q74jr4Ov1FaZ+bR411Zxfqtovme3S2KXCCfgAIKlVt7LwYumj2pMKTrpTUO KoIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=EZ3Mzm64; 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=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si6354472plt.394.2019.01.06.12.17.50; Sun, 06 Jan 2019 12:18:19 -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=@alliedtelesis.co.nz header.s=mail181024 header.b=EZ3Mzm64; 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=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726089AbfAFUOO (ORCPT + 99 others); Sun, 6 Jan 2019 15:14:14 -0500 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:41799 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbfAFUOO (ORCPT ); Sun, 6 Jan 2019 15:14:14 -0500 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 1EF3A83640 for ; Mon, 7 Jan 2019 09:14:10 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1546805650; bh=sauq8Ak0NA/hu0r68YByY7HAbkG0FNhLK81Z2GphIBk=; h=From:To:CC:Subject:Date:References:In-Reply-To; b=EZ3Mzm64cLpBA+ZSlnqfFoPaQCbn1Eh1hsjr6Kupdn3XhssAixtAJ15IXXZhCdnFH o/dfYZEqwuhkn5XIEf9fWbowo9zqI9Ktea9WaNLdc3M+BeoQ935HEBCtnMCg+4ZP1Q 8wlntULHEPor6/fN+YAPdt+SurDlGXzsoQAYQGmEA7XRrizz9xPvwU9JeI3VxSTXAL oUn5JcSkV+ZKihkPGvKrYpwkGSlSebhS2Go6QJHZ49Gq5n5Di/QexNKmaxwIRZ1OH2 eRgAVpyKUUcnh7lGfyQXmPfWMC+pShqCKufpqUZgyWgbyUpa4lLo+markhDcpXYe3U uG/9OqhdNLpOA== Received: from svr-chch-ex1.atlnz.lc (Not Verified[10.32.16.77]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Mon, 07 Jan 2019 09:14:10 +1300 Received: from svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8:409d:36f5:8899:92e8) by svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8:409d:36f5:8899:92e8) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Mon, 7 Jan 2019 09:14:06 +1300 Received: from svr-chch-ex1.atlnz.lc ([fe80::409d:36f5:8899:92e8]) by svr-chch-ex1.atlnz.lc ([fe80::409d:36f5:8899:92e8%12]) with mapi id 15.00.1156.000; Mon, 7 Jan 2019 09:14:06 +1300 From: Hamish Martin To: "liujian56@huawei.com" , "gregkh@linuxfoundation.org" CC: "linux-kernel@vger.kernel.org" , "michal.simek@xilinx.com" Subject: Re: [PATCH v2] driver: uio: fix possible memory leak and use-after-free in __uio_register_device Thread-Topic: [PATCH v2] driver: uio: fix possible memory leak and use-after-free in __uio_register_device Thread-Index: AQHUo+SOnwOVcfp22Umyw8dsnaIvcKWh1weA Date: Sun, 6 Jan 2019 20:14:05 +0000 Message-ID: <1546805645.4217.2.camel@alliedtelesis.co.nz> References: <1546611548-205765-1-git-send-email-liujian56@huawei.com> In-Reply-To: <1546611548-205765-1-git-send-email-liujian56@huawei.com> Accept-Language: en-NZ, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.18.5.2-0ubuntu3.2 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [2001:df5:b000:24:3a2c:4aff:fe70:2ab9] Content-Type: text/plain; charset="utf-8" Content-ID: <9827FD157999D447B451FE9F55068C54@atlnz.lc> Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gRnJpLCAyMDE5LTAxLTA0IGF0IDIyOjE5ICswODAwLCBsaXVqaWFuIHdyb3RlOg0KPiAnaWRl dicgaXMgbWFsbG9jZWQgaW4gX191aW9fcmVnaXN0ZXJfZGV2aWNlKCkgYW5kIGxlYWsgZnJlZSBp dCBiZWZvcmUNCj4gbGVhdmluZyBmcm9tIHRoZSB1aW9fZ2V0X21pbm9yKCkgZXJyb3IgaGFuZGlu ZyBjYXNlLCBpdCB3aWxsIGNhdXNlDQo+IG1lbW9yeSBsZWFrLg0KPiANCj4gQWxzbywgaW4gdWlv X2Rldl9hZGRfYXR0cmlidXRlcygpIGVycm9yIGhhbmRpbmcgY2FzZSwgaWRldiBpcyB1c2VkDQo+ IGFmdGVyDQo+IGRldmljZV91bnJlZ2lzdGVyKCksIGluIHdoaWNoICdpZGV2JyBoYXMgYmVlbiBy ZWxlYXNlZCwgdG91Y2ggaWRldg0KPiBjYXVzZQ0KPiB1c2UtYWZ0ZXItZnJlZS4NCj4gDQo+IEZp eGVzOiBhOTNlN2IzMzE1NjggKCJ1aW86IFByZXZlbnQgZGV2aWNlIGRlc3RydWN0a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