Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2202794iof; Tue, 7 Jun 2022 23:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFBH+m6aNhSuSm7mybBzJdanxbruZJspbxKyQ3kPfFnygEEJ1DYhSgH4fFoxNss/b4lfFh X-Received: by 2002:a17:90b:1650:b0:1e4:cff1:5a86 with SMTP id il16-20020a17090b165000b001e4cff15a86mr36049187pjb.30.1654668334958; Tue, 07 Jun 2022 23:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668334; cv=none; d=google.com; s=arc-20160816; b=nmPYHUfLM+M1aGc2vLokZpCLY3fsn0IFU1/iLF1eujhZYLWCm5kmKyUF/8+0VT0kB3 t8GR/dIapY5boJHFF+kNgIg1Rd9U1CeC26oHjmuBxGAmu9EAy7B3kGJ3f27WIA38MPEp PIJI/WN/oicUatX+/Y7/nUmTEwOt7H3paz7PGK0whPJv27cMey5wjbklbx4YZOpDXFUC 2WNLn5A8h6Ptgc/Ls6s3OYCpvHKrZg3DB+N4YsBe2LARUoa95ciaEQhjoP/kL1/MHaYP s6LbZNrWYz4RlFKsvpW7mg0OWroIQYoi23QBlK/GQbskfiQQr4rYBTrka7HXNaoKkLTx CdcA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=y0wr4gaN+XwN/EwRWi5sLFO7BambTjZ1zOs5QDPUsYo=; b=lqZaYF8/dI8lhNbnHevzqBDbU1/lHlcsIRwnu7jPM8plR7gsT099sbwrqhi7fuiV39 LWcumjpDOITUBLSE38vdegGRxTIg0ztP65CosaxofOIjGoJ+Ee0IUdDm+qBQ0t9s2jOi W6WbFo49my90JFk8Qu+ighxcQScy9Ul68AfzxEeaAr2t6Z9caTqguHaFnk+3nxwwitxZ Oe54QtwkOwX1c9pCCcNZQLSjTPx4uWrwRUb4qnDhAUJR7ru0U4V1sP6cPyQ3/yOU09Xh HWkMrXT8gGiyxPGXu4iwcJHZdg5+hUtLss19mdv0EjZjShgSyOvwfmwRq2p1tMyZVIaN waNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zKi0NoQi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x24-20020a63db58000000b003fce456b2e4si26510327pgi.502.2022.06.07.23.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:05:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zKi0NoQi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 677A8108AA4; Tue, 7 Jun 2022 22:30:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231558AbiFHB32 (ORCPT + 99 others); Tue, 7 Jun 2022 21:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384597AbiFGWUi (ORCPT ); Tue, 7 Jun 2022 18:20:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4361263DC6; Tue, 7 Jun 2022 12:20:50 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id B8AA2609FA; Tue, 7 Jun 2022 19:20:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C51EEC385A2; Tue, 7 Jun 2022 19:20:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629641; bh=wgKRNI73T2zZGmaV8LU9D8Jm69k2YDtN51rVD4phD80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zKi0NoQibCWq/4Oj96Ch4VdTfxrhQBPvsX8TdQ2xaLG+AGI6Bi0sOxKtVqrwTK9Mh +db9qwHJ6q18A4ou+jQCI2KqaQGtQ4xeqvojoSYUp5NjmOPLgj6OrsphJNcbp5F0T9 tFBU2kJj6HZ6QcAJEG/O9UgJrlPfKnOIi9oSnVpE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 5.18 723/879] iwlwifi: mei: fix potential NULL-ptr deref Date: Tue, 7 Jun 2022 19:04:01 +0200 Message-Id: <20220607165023.839965948@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 From: Johannes Berg commit 78488a64aea94a3336ee97f345c1496e9bc5ebdf upstream. If SKB allocation fails, continue rather than using the NULL pointer. Coverity CID: 1497650 Cc: stable@vger.kernel.org Fixes: 2da4366f9e2c ("iwlwifi: mei: add the driver to allow cooperation with CSME") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman Link: https://lore.kernel.org/r/20220517120045.90c1b1fd534e.Ibb42463e74d0ec7d36ec81df22e171ae1f6268b0@changeid Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mei/main.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/wireless/intel/iwlwifi/mei/main.c +++ b/drivers/net/wireless/intel/iwlwifi/mei/main.c @@ -1020,6 +1020,8 @@ static void iwl_mei_handle_sap_data(stru /* We need enough room for the WiFi header + SNAP + IV */ skb = netdev_alloc_skb(netdev, len + QOS_HDR_IV_SNAP_LEN); + if (!skb) + continue; skb_reserve(skb, QOS_HDR_IV_SNAP_LEN); ethhdr = skb_push(skb, sizeof(*ethhdr));