From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2AE57C83F05 for ; Fri, 25 Aug 2023 23:55:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230117AbjHYXyu (ORCPT ); Fri, 25 Aug 2023 19:54:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjHYXyl (ORCPT ); Fri, 25 Aug 2023 19:54:41 -0400 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F192681 for ; Fri, 25 Aug 2023 16:54:38 -0700 (PDT) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5654051b27fso831441a12.0 for ; Fri, 25 Aug 2023 16:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693007678; x=1693612478; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=VpMaAc/+rHUYpU/kaviuY/CqhSZVdXyXfaFB/RaptSE=; b=mCfvTqg8FBDz1xZGzDewFoKOiGUsFkij77b1+ZGW6euJFr+oubteZ+icOhhVMzvRze AnYBs6QzAOIhI6Hv3Fo3C5ZRs0RDbHFH2O3Fr4o7W0AicrUo0f6gvJJ91snHrvLWYJ0T 3duJox9k0dAnldDQBXSw38k54/oXQaTvFY7ro= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693007678; x=1693612478; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VpMaAc/+rHUYpU/kaviuY/CqhSZVdXyXfaFB/RaptSE=; b=O9ztGlfBAl0S2W9XTsxNe5WO9C2G8SAqjb+ARKKLZ4yxlmVg63VVqPwW5xZcAo3ROI QsvxBVo4XGeqUal039bIqqI91lcBsyLYG+A/a7WvZAm/IgEXEaUOzEY2e9QH45gSqWVJ VBi0Q0df3LK0TV0bcg5yZLP1z8VnTCWjngRyH1JtqfiCvJTWkPETbMJqdl8aoM1lzlUB GM2wG16Oxgf6n0qxhJEn0brTG1Da/O5cH6AbimoRTt6/4eYhcfq77poA/Zq1ApruU6OU jpkcv3xTMkxXLD5MXOgKgsM6rpm7jSo5IXmQW5pYZs5ut3arHZzLe36JNQLS2oca9F60 79DA== X-Gm-Message-State: AOJu0YxNqemzjiojnb7Bx+PotNB6KSWRqJ4PV1r+/sELkgbb0lTTXsDv zj3PgL5V2XKHW/XkVMmm5H04Fw== X-Google-Smtp-Source: AGHT+IFEuZ99MPLIDqpxwG1Vt4boeH8jtHmkm9WzqpyWAxYtGeHG9/wvuJT+nhNSmfJ03PfN2NFqmQ== X-Received: by 2002:a17:902:8bc4:b0:1b8:36a8:faf9 with SMTP id r4-20020a1709028bc400b001b836a8faf9mr19617146plo.38.1693007678180; Fri, 25 Aug 2023 16:54:38 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id jk13-20020a170903330d00b001b881a8251bsm2345723plb.106.2023.08.25.16.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 16:54:37 -0700 (PDT) Date: Fri, 25 Aug 2023 16:54:36 -0700 From: Kees Cook To: Brian Norris Cc: "Gustavo A. R. Silva" , Kalle Valo , Amitkumar Karwar , Xinming Hu , Dan Williams , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 3/3] wifi: mwifiex: Sanity check tlv_len and tlv_bitmap_len Message-ID: <202308251653.72F1ADC417@keescook> References: <202308251410.8DAA6AC5E@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Fri, Aug 25, 2023 at 04:38:56PM -0700, Brian Norris wrote: > On Fri, Aug 25, 2023 at 2:10 PM Kees Cook wrote: > > On Thu, Aug 24, 2023 at 09:10:45PM -0600, Gustavo A. R. Silva wrote: > > > + mwifiex_dbg(priv->adapter, WARN, > > > + "TLV size (%zu) overflows event_buf buf_left=%d\n", > > > + size_add(sizeof(tlv_rxba->header), tlv_len), > > > + tlv_buf_left); > > > > With the suggested change to make this a warning and not dbg: > > mwifiex_dbg(..., WARN, ...) *is* a warning, not a debug message. Or at > least, that's how it's used throughout this driver, even though it > actually yields a dev_info()-level message, regardless of the 'mask' > arg: Oh duh. My eyes didn't get any further than "dbg". My bad! Yes, this is good as-is. :) Sorry for the noise! -Kees -- Kees Cook