Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp2142188rwb; Thu, 19 Jan 2023 21:54:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXutwliW5OOjvVDLRfQgW/88aU52dCK74hebH8PEXbpfQTnk8p06oCScplkLXp80ymOqk1sP X-Received: by 2002:a05:6a21:3987:b0:af:be2a:208f with SMTP id ad7-20020a056a21398700b000afbe2a208fmr13830916pzc.33.1674194079440; Thu, 19 Jan 2023 21:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674194079; cv=none; d=google.com; s=arc-20160816; b=mkuNMaxL3R+r9V73UFU+HODd2YJ/sAdYhVZct3H4AMxo51Rg4wZQVkaz8/ktBLOF6e ToiXBb+C0x8oQNZdopDrIFy1PE7p+LtdFxN6OzqK6mMN6VNFi2XMwfMJKOABBpSE76ab N9wq6uLMTxzQcrMHpe5mBbwXGnMv2g3kKe7/cyGADeFCojHdP85ifBXH2U8itEb0fxgi R9dAXPhkTP6aIoP6yucvltO5zxUSIF0gsgFYwyoe1ZBY+vaZgK9vMRH2Kia26mhEiPrF Ueu4LccHLE5V2GG9PxQXLqBGDjNwkeE2I2LjIak1sU+gP+PKsWRRXC5crDJWvF1fiXa/ Psiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dzM/uyO5HuHFaxQrXwQ3IqEu3Ak8t6lTaZjp+B0JhEQ=; b=Cl3u7qIb9fJLHBAozCvPuyebEC8xLyMo+6DkdDaGC6UJ2EMboUM5AiN6aAccRkGcI3 Wegs5s4xpYNL5GedmW5hHIcp+B6Oun2AA5bLfDWpEr912y8fuKWr+Lw+dRMcLO15Hls3 837edzmtEdW+kuV+gNJjqO3cTV2OXndKB83666R+8KIXGL1tRshOw51P6rn0x8SssUPa ZYW4mW5dQYkUqOX2FK/0BhoTUWzmL8Rz/XCcotC5Z0Mx/yHVNxhNKAdeAFuhYonxiR8q nOseBf1VE2Lv+SNPeLVJ0v4OWRRj8QYsFzAYcxPXailYNfJ8vG26CTTou7mH3kJi9SXr +iBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z3pFPo2i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a056a0008c400b0057fe4c0dbe6si43441768pfu.298.2023.01.19.21.54.33; Thu, 19 Jan 2023 21:54:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z3pFPo2i; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230324AbjATEvK (ORCPT + 47 others); Thu, 19 Jan 2023 23:51:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjATEu1 (ORCPT ); Thu, 19 Jan 2023 23:50:27 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AFBBBFF40 for ; Thu, 19 Jan 2023 20:43:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F31C0B8270A for ; Thu, 19 Jan 2023 19:18:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52963C433F0; Thu, 19 Jan 2023 19:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1674155894; bh=4gNZacUVu7Qe2Z2/07/8mXyL5AH7AsaHEp2psjaXZUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z3pFPo2iBQ2puU/Wzg/SlUhsvygxszIrdglZCdyOZGM5ZJF3JjDJ3Y5oPAd6gcGjf OpvZa1H3tq/LTua4sr8EhBg3/E06G7WPm1m0/BrZ07wveUy6rEvQ04z5SGUT02jNQT QGki7K+IWMbGSFIUsxo/RNpA9IWDlyJdMNYvv1io= Date: Thu, 19 Jan 2023 20:18:12 +0100 From: Greg Kroah-Hartman To: Alexander Shishkin Cc: mst@redhat.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, elena.reshetova@intel.com, kirill.shutemov@linux.intel.com, Andi Kleen , Amit Shah , Arnd Bergmann Subject: Re: [PATCH v1 1/6] virtio console: Harden multiport against invalid host input Message-ID: References: <20230119135721.83345-1-alexander.shishkin@linux.intel.com> <20230119135721.83345-2-alexander.shishkin@linux.intel.com> <87fsc6qrvx.fsf@ubik.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87fsc6qrvx.fsf@ubik.fi.intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 19, 2023 at 08:52:02PM +0200, Alexander Shishkin wrote: > Greg Kroah-Hartman writes: > > > On Thu, Jan 19, 2023 at 03:57:16PM +0200, Alexander Shishkin wrote: > >> From: Andi Kleen > >> > >> --- a/drivers/char/virtio_console.c > >> +++ b/drivers/char/virtio_console.c > >> @@ -1843,6 +1843,9 @@ static int init_vqs(struct ports_device *portdev) > >> int err; > >> > >> nr_ports = portdev->max_nr_ports; > >> + if (use_multiport(portdev) && nr_ports < 1) > >> + return -EINVAL; > >> + > >> nr_queues = use_multiport(portdev) ? (nr_ports + 1) * 2 : 2; > >> > >> vqs = kmalloc_array(nr_queues, sizeof(struct virtqueue *), GFP_KERNEL); > >> -- > >> 2.39.0 > >> > > > > Why did I only get a small subset of these patches? > > I did what get_maintainer told me. Would you like to be CC'd on the > whole thing? If you only cc: me on a portion of the series, I guess you only want me to apply a portion of it? if so, why is it a longer series? > > And why is the whole thread not on lore.kernel.org? > > That is a mystery, some wires got crossed between my smtp and vger. I > bounced the series to lkml just now and at least some of it seems to > have landed on lore. > > > And the term "hardening" is marketing fluff. Just say, "properly parse > > input" or something like that, as what you are doing is fixing > > assumptions about the data here, not causing anything to be more (or > > less) secure. > > > > But, this still feels wrong. Why is this happening here, in init_vqs() > > and not in the calling function that already did a bunch of validation > > of the ports and the like? Are those checks not enough? if not, fix it > > there, don't spread it out all over the place... > > Good point! And there happens to already be 28962ec595d70 that takes > care of exactly this case. I totally missed it. So this series is not needed? Or just this one? greg k-h