Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4098972pxb; Mon, 8 Feb 2021 07:56:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwd9vAcxSneK++82db4ZKmkEhKfqY7xuN4GlwtmZWY4eoq86PITUYi5lEe/EfH3Z4I+BY3Q X-Received: by 2002:a17:906:1199:: with SMTP id n25mr17358990eja.431.1612799806318; Mon, 08 Feb 2021 07:56:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612799806; cv=none; d=google.com; s=arc-20160816; b=uk6zBtB2Er2FZIfuAVpy6zTupcHUbRO7BO0BQRzSl45PtfwbjgagXotQUD40v2rjIn yj3ahPyz7QJUDrFa4G7iDDW/3xkWxhZwkHYj2e7Of4tSaNveE1IT+Bte458d2IQ2GYCn IOa3pDNIkYFsQvbTcbTfC4oQg86e2LCb7jXQLw5CczEKp2UCgJrh/AlE46VjQ12g6PFk TSr8fSwDwmFgzNbkweqfFgCaxxQNZhs8kgrVTWfZZ9fcZDqvct3+OBqWcoyTI3Js+pRe 9T5gSuOF3tJqOR4bkN+MzWlv4rdJLy04WuY0PEaaQyqG5tzau4la02WVk5XfMpjo3xsG TIAw== 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:ironport-sdr:ironport-sdr; bh=50iPyeHEy3VhjJbuneOKYlj4sbbDhSujXqggdTKphyQ=; b=CMg2TxeWonxfzq2702O97BAkGj2dkydRpLJvR0GGMPLTr+XvMyBp1zzlet+MduYLcw CcS2Na0abXH31fcH2pDMgvPzvzMi4roThSuMQ07WelY7bPqqqNgUXtDt++TlEPdTxwgf CBA0vwSSwPbBiBirxSBrlb6XH0o7ypKtKN4mdWBts8hxyjsUG3UjhLJKUHiMjmsoUjj3 mpGzduPkcNyB2REDX3T0Qsj5soMlpkQttabEpv9jFJHKV1k3Uirdg1gzevCadAeNz78g GP3ri+TBi4+bMPZtNUBDyvxrJPWTXQuFPuFfJzV9aNz754H87X3KIVSjimckQwSh3Pk5 2IxQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q26si11548286edt.415.2021.02.08.07.56.20; Mon, 08 Feb 2021 07:56:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232428AbhBHPxY (ORCPT + 99 others); Mon, 8 Feb 2021 10:53:24 -0500 Received: from mga09.intel.com ([134.134.136.24]:25623 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbhBHPHo (ORCPT ); Mon, 8 Feb 2021 10:07:44 -0500 IronPort-SDR: JuaLT8piz4shZlXv5SnZ3liFF+DLxSu6XCFfcwTueTGGJ4njkY7erH/gst9JlmM5nOlOrBK75a DqgpggVdUNRg== X-IronPort-AV: E=McAfee;i="6000,8403,9888"; a="181871129" X-IronPort-AV: E=Sophos;i="5.81,162,1610438400"; d="scan'208";a="181871129" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 07:07:04 -0800 IronPort-SDR: mkRsbQyU3E3f9hCdH1zSf8UEuNmTnN83q9XKoSbMon5eaqhShSD0/eLzGBMaPeybsS5tWF9jVe gl1+y8wHCNiQ== X-IronPort-AV: E=Sophos;i="5.81,162,1610438400"; d="scan'208";a="395414222" Received: from twinkler-lnx.jer.intel.com ([10.12.91.138]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Feb 2021 07:07:02 -0800 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Tomas Winkler Subject: [char-misc-next 1/2] mei: bus: block send with vtag on non-conformat FW Date: Mon, 8 Feb 2021 17:06:48 +0200 Message-Id: <20210208150649.141358-1-tomas.winkler@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Usyskin Block data send with vtag if either transport layer or FW client are not supporting vtags. Cc: # v5.10+ Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/bus.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c index 34fb5e541fe5..be99bb0a16cf 100644 --- a/drivers/misc/mei/bus.c +++ b/drivers/misc/mei/bus.c @@ -61,6 +61,13 @@ ssize_t __mei_cl_send(struct mei_cl *cl, u8 *buf, size_t length, u8 vtag, goto out; } + if (vtag) { + /* Check if vtag is supported by client */ + rets = mei_cl_vt_support_check(cl); + if (rets) + goto out; + } + if (length > mei_cl_mtu(cl)) { rets = -EFBIG; goto out; -- 2.26.2