Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4272510ybi; Mon, 29 Jul 2019 22:58:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqx+gaYZ3LE6KquyelXxlz0hBGMbp8b8PSUjcIEvrHhMGABZpEHZds6GL4IpPBq2VF34APZU X-Received: by 2002:a17:902:9f8e:: with SMTP id g14mr67887925plq.67.1564466291663; Mon, 29 Jul 2019 22:58:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564466291; cv=none; d=google.com; s=arc-20160816; b=x1eZdkvR/Djz0eGZXxIauDVnR72dVmZizsPxDz/mMx8IisIC54/ci09Ciugzpi84HY 0lpOlicKOuGJXLouepzfU0XQkagC23f00d1WSESZibUY/uMPJwTUZOe+NJE+nKrdmG0C GGaIRWaC176B2WGihelDe/AtkX2YO9ZWdxRM4BQGNtT4kPooNTSSP2S+bjG4vXd15DYy bpVNfICnL6IzvpvYSMm98VqZ7BkRq9N0sy5Yy1OrPu8n3yAusQcv8WMWFnWTnATHsq9v 8zcUYTCVreNi5jG1OB0eh4DXUSNm4Hjr4tBF06YlJZPIakyHOaSoCnY3xZ7fzGygXxb3 pV2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:content-transfer-encoding :mime-version:cc:to:rt-originator:managed-by:rt-ticket:message-id :references:in-reply-to:reply-to:subject:from; bh=QFsFSfg7rBa1eFK2KjWRUCSalzjuHEMZg6WAxYEPs5I=; b=lk8t+9zX2ndp8smCn2RDJ++qff446L4yl1I+AP57O7WlxtqWBK1y75O/VwIoz91A+z gJybsIB3qLNAjt1q7946X/i+gePq+kGoJrOpbAyTDTTztZRDBN/30mo/mxJO1Nmqbh6A QKgfbxqbLq0f9httuoJ1nQQo0T8RiHAmQz8VzXKDmM2Jg2uL0ZZ/AlmZL+UYfTodfuUa 6KYwmljn7t/21wMvBL/RCJdnRJkDXlQIlKIZfuBkYbdRVd9VeKMILaXAjBCODPFOy7O9 eH3C5Q92bVzPMWHK5pjasPitwZf0Zvkwl8sMLUrBF8MjHsLrvGe/OC4QAtzbqv9tX8tp HRAA== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si25619270plp.212.2019.07.29.22.57.56; Mon, 29 Jul 2019 22:58:11 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727655AbfG3FwE (ORCPT + 99 others); Tue, 30 Jul 2019 01:52:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51842 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726169AbfG3FwD (ORCPT ); Tue, 30 Jul 2019 01:52:03 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C74259455; Tue, 30 Jul 2019 05:52:03 +0000 (UTC) Received: from rt4.app.eng.rdu2.redhat.com (rt4.app.eng.rdu2.redhat.com [10.10.161.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 476045DAA4; Tue, 30 Jul 2019 05:52:03 +0000 (UTC) Received: from rt4.app.eng.rdu2.redhat.com (localhost [127.0.0.1]) by rt4.app.eng.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id x6U5q270005348; Tue, 30 Jul 2019 01:52:02 -0400 Received: (from apache@localhost) by rt4.app.eng.rdu2.redhat.com (8.14.4/8.14.4/Submit) id x6U5q1aH005347; Tue, 30 Jul 2019 01:52:01 -0400 From: Red Hat Product Security X-PGP-Public-Key: https://www.redhat.com/security/650d5882.txt Subject: [engineering.redhat.com #494735] Re: [PATCH] nbd_genl_status: null check for nla_nest_start Reply-To: secalert@redhat.com In-Reply-To: <20190729164226.22632-1-navid.emamdoost@gmail.com> References: <20190729130912.7imtg3hfnvb4lt2y@MacBook-Pro-91.local> <20190729164226.22632-1-navid.emamdoost@gmail.com> Message-ID: X-RT-Loop-Prevention: engineering.redhat.com RT-Ticket: engineering.redhat.com #494735 Managed-BY: RT 4.0.13 (http://www.bestpractical.com/rt/) RT-Originator: darunesh@redhat.com To: navid.emamdoost@gmail.com CC: axboe@kernel.dk, emamd001@umn.edu, josef@toxicpanda.com, kjlu@umn.edu, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, nbd@other.debian.org, smccaman@umn.edu MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" X-RT-Original-Encoding: utf-8 Date: Tue, 30 Jul 2019 01:52:01 -0400 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 30 Jul 2019 05:52:03 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Navid, Thank you for you report. I have forwarded this to our analysis team. Once I'll get an update on your reported vulnerability and it's patched I'll let you know. Please let me know if you have any questions or concerns. On Mon Jul 29 12:42:56 2019, navid.emamdoost@gmail.com wrote: > nla_nest_start may fail and return NULL. The check is inserted, and > errno is selected based on other call sites within the same source > code. > Update: removed extra new line. > > Signed-off-by: Navid Emamdoost > --- > drivers/block/nbd.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c > index 9bcde2325893..2410812d1e82 100644 > --- a/drivers/block/nbd.c > +++ b/drivers/block/nbd.c > @@ -2149,6 +2149,11 @@ static int nbd_genl_status(struct sk_buff *skb, > struct genl_info *info) > } > > dev_list = nla_nest_start_noflag(reply, NBD_ATTR_DEVICE_LIST); > + if (!dev_list) { > + ret = -EMSGSIZE; > + goto out; > + } > + > if (index == -1) { > ret = idr_for_each(&nbd_index_idr, &status_cb, reply); > if (ret) { -- Best Regards, Dhananjay Arunesh, Red Hat Product Security 7F45 FDD1 BB92 2DA8 CD05 F034 9B3D 8FE3 50EC 5D74