From patchwork Thu Jan 19 13:57:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shishkin X-Patchwork-Id: 4256 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp475643wrn; Thu, 19 Jan 2023 10:18:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXsX3B+u/aKzAJSk5pnKbBNvE+BOav69uyCqh5ZFxvcAlFFSemO+GkFR9/z6RcpJSQA/14DF X-Received: by 2002:a17:902:e810:b0:189:e577:c83d with SMTP id u16-20020a170902e81000b00189e577c83dmr16136002plg.66.1674152294268; Thu, 19 Jan 2023 10:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674152294; cv=none; d=google.com; s=arc-20160816; b=guExrdY4e3uS/jWo764VjYASUk9jUZ1TXQ++3ok/Vwj51G5UG2eOS0rRia85a9Ot/y G7nfNGEZQpX6knMRUYh+7eyctZnsSoF5wlC5OqQn0tIrs2cVO+GQ2g8ThSnZbi759175 EbmAaKlo0JbM55tkxE+K7q9kW0oaqfW3EEuHixlbCYESNTOD73CwJEYfJN8ALbolfdpJ 2wFf/k45DOga0q18S5vLjdvsmF8NmVeMP6uXMha71Oh8QEszWQsP46o4V5vzNoYkC4Ts 0aIVNft5gpp0xS3EzQ5vMWP6l3MAv8GI6TsrDYlD5t31wqCgedtJb6SPEyul/Bro7wLW AYrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=sI+gbGGxoujv4j+rj39AeAPq1/KAVRo4Pqdvy0ToQzU=; b=pxYRwXSyjh9tLj3rAsY5QEoFuBdmFJntQ5JnUjercsCTxBSXopIOjpltl1MLRtvqaA RcG7cpf3DdZO8xNSKGHG5epfBzHaQerPqkWVr6SJzbdtULgBopFnZZMVDVdYteNdXQTO HOl163h7QijC3/z3WbWm8XNjQs7RNlJhglOe/ezEA6/36/gseZR1YWmkfSpjCfXIhLvN eXF7LYM76eZedajy/9TYeancGPFxVAo/yVXjYcQqvHh9zgOSuqM13mBG39bWbp6jE8NN cZsSrY7XuaUPuvJr3SqAs2hoBlCr+rn0/So4v1nzyjf1sPx/vjl9O9kn9TKnyMbQ5b5C v4Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@intel.com header.s=Intel header.b=G40gK9Lg; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e10-20020a63aa0a000000b00477bb3c1b5csi39309018pgf.871.2023.01.19.10.17.59; Thu, 19 Jan 2023 10:18:14 -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=fail header.i=@intel.com header.s=Intel header.b=G40gK9Lg; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230003AbjASSMh (ORCPT + 99 others); Thu, 19 Jan 2023 13:12:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbjASSMf (ORCPT ); Thu, 19 Jan 2023 13:12:35 -0500 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8EA126B4 for ; Thu, 19 Jan 2023 10:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674151953; x=1705687953; h=resent-from:resent-date:resent-message-id:resent-to:from: to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ZQv7ckOWXUugQsn2n86dUai3CBZCoAI9JjoSBknnenY=; b=G40gK9LgIlaBkD6wHTWDyIcejY762FAzLUh3F0kh9DXW/m5dG3+vSTk5 Fb6kI4shOS7j5ICPsJhPNCLLlCxAgmhwIUHxGzlTMZe/wbuZIcJ4hB/n/ XnFNF2WN61m9Qxk0NxQ5td7ZXZO/PWrZrHFi+qwofB4cZZvzLm7hJW5/s tjwHuWEszPLfLtrUV2gYGpJd7I47HaJ6CPpE4a2MTaa1y3wON8+ld4mYC hQVhluLeMi7KYB2o7/vV3igpbgulr2GSh8RV0lbSOagAxkRFyIbcYQAeo qOafpdLnHxsdE4k2e+1r3ExbhZzIDyqbwhftr2/XagYuyHBsSbbSYO80V Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="305736630" X-IronPort-AV: E=Sophos;i="5.97,229,1669104000"; d="scan'208";a="305736630" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2023 10:12:33 -0800 X-ExtLoopCount2: 2 from 10.237.72.184 X-IronPort-AV: E=McAfee;i="6500,9779,10595"; a="802737551" X-IronPort-AV: E=Sophos;i="5.97,229,1669104000"; d="scan'208";a="802737551" Received: from ubik.fi.intel.com (HELO ubik) ([10.237.72.184]) by fmsmga001.fm.intel.com with ESMTP; 19 Jan 2023 10:12:32 -0800 Received: from ash by ubik with local (Exim 4.96) (envelope-from ) id 1pIZOX-00EPGt-1H for linux-kernel@vger.kernel.org; Thu, 19 Jan 2023 20:12:13 +0200 X-Original-To: alexander.shishkin@linux.intel.com Received: from linux.intel.com [10.54.29.200] by ubik.fi.intel.com with IMAP (fetchmail-6.4.29) for (single-drop); Thu, 19 Jan 2023 15:59:02 +0200 (EET) Received: from fmsmga005.fm.intel.com (fmsmga005.fm.intel.com [10.253.24.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 77D81580AE0; Thu, 19 Jan 2023 05:57:03 -0800 (PST) X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10594"; a="988993903" X-IronPort-AV: E=Sophos;i="5.97,229,1669104000"; d="scan'208";a="988993903" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Jan 2023 05:57:01 -0800 From: Alexander Shishkin To: mst@redhat.com, jasowang@redhat.com Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, elena.reshetova@intel.com, kirill.shutemov@linux.intel.com, Alexander Shishkin Subject: [PATCH v1 0/6] Harden a few virtio bits Date: Thu, 19 Jan 2023 15:57:15 +0200 Message-Id: <20230119135721.83345-1-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755475916229596232?= X-GMAIL-MSGID: =?utf-8?q?1755475916229596232?= Hi, Here are 6 patches that harden console, net and 9p drivers against various malicious host input as well as close a bounds check bypass in the split virtio ring. Changes since previous version: * Added Christian's R-B to 3/6 * Added a speculation fix per Michael's comment on the cover letter * CC'ing lkml Alexander Shishkin (3): virtio console: Harden control message handling virtio_net: Guard against buffer length overflow in xdp_linearize_page() virtio_ring: Prevent bounds check bypass on descriptor index Andi Kleen (3): virtio console: Harden multiport against invalid host input virtio console: Harden port adding virtio 9p: Fix an overflow drivers/char/virtio_console.c | 19 ++++++++++++------- drivers/net/virtio_net.c | 4 +++- drivers/virtio/virtio_ring.c | 3 +++ net/9p/trans_virtio.c | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) Signed-off-by: Alexander Shishkin