Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1808130lqg; Mon, 4 Mar 2024 04:42:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV3JNdt5KxndnKXwKEU9gkrGKvBEmkUiDw2qnrXBWBRSRf61rlAm2zlMX8clW+dF1ddezh7rFFc+3KEbCdMDh3ZM+QuUoHKW505Vzn6YA== X-Google-Smtp-Source: AGHT+IH+O04IEvbOvG/WwIaKyQ35dgh0Cso+CLdi7WzRfBtPKveYBVa9hwsIu4yguZqi1bwIaBpc X-Received: by 2002:a05:6358:6204:b0:17c:d2b:7236 with SMTP id a4-20020a056358620400b0017c0d2b7236mr4920306rwh.30.1709556123713; Mon, 04 Mar 2024 04:42:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709556123; cv=pass; d=google.com; s=arc-20160816; b=jBesOXcW3rFKrPEsN8IxFqReack7erfXWW3wLXavUoqglPR1idljXKfHRGk1s+dl2x 4BFmPv2DrhspmJYCYVat1R7vJjsFVKpwuzKzfZHzd4Ks3+mMB32sGBXgp/l8ckudpdPs e3IvEClgu/e19c/61796b0mc/+qc5kMzvdK/JEnHzqa4tWzYc8UZCeLjf+g9eM4bc50/ jxgTTJ3lqUM94B/kieClCKQOFBaVexI7Wh9y6yFdl/LWfIjF7cCBoLHRqCto67z4ARK8 CpPCne7sKZW/O6v3dU9f569hgslr3sRTXdwNO33tzuJBG5sRxnFm4YN6/ACxUhuGv6Wr gz4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=Vnxyeku5nBThkENy2YLUDyCGqIdb3PA8BNRbaju8iPA=; fh=BVYTgPrGPVujvM3kXY17BP1soyVuT8CBonuIr2+7OIA=; b=HPOdTB6+GpxANkng4izVIuPlAPF5waXWa9DYyepWXQTXINK+S4P7eLew7ciTzuQeqx 2MUrnhjssT4LmX04hn1aJKDTKoOQftVeMVDF8Uwl/6soM4y87aCHjvxpLOmNllzIKTWZ fWnrLjboGvVcWOX5ZnoZj9aFg0Ol6AfX1+6QXVAst9F+ZGaKVfmPAPRBd59DNokEvSEv PFMRyQgRozUVgJM0tartGoTK6+hs2oj1xgUrCrmUDDnM8c0XiPiLwaQC65Y7lpL/kNsH Hzmq7qB9w7uRkzkbKPI594iQ66poY4hxyfuVsSXlQ+2lw+/QfSug7dQl7xSV/0bEMHyC hjxw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gnumonks.org); spf=pass (google.com: domain of linux-kernel+bounces-90585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90585-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j10-20020a05620a0a4a00b00787aa53655bsi9462818qka.262.2024.03.04.04.42.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 04:42:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gnumonks.org); spf=pass (google.com: domain of linux-kernel+bounces-90585-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90585-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 70D9E1C230D1 for ; Mon, 4 Mar 2024 12:41:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A116D3D3A1; Mon, 4 Mar 2024 12:41:31 +0000 (UTC) Received: from ganesha.gnumonks.org (ganesha.gnumonks.org [213.95.27.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CC9F1D53F; Mon, 4 Mar 2024 12:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.27.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709556091; cv=none; b=JeLnROQ5uW+KQKkGXLrgDnQzpEcT72aJrZhR4ROrW23C+iRXwtvxjZhTsmw6QNNb2b2HtU9SE/OYzcWONZ4Hzxo/RkyBQ/pO1dOXyUICRHKF9fkADl9VNjvaNQszaNHac6q3AFvc8LdymlKWiGA89aBpv02kg01ERsDYLlnuc6o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709556091; c=relaxed/simple; bh=n4TJ0d6qjbOI8Xx4ib2oaN7MTZY5YsSPrg9jw/wrV3M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YM0hx++jARa8qL8cLmfS+mrL5bfdiRJBmAmGy8hNR0CwOLiXqFTJ6CHRE8nM1cTD1sC39yIk453Jg/EWdLFJ/QDa0zwcQttgOeSE7MEm3jAjaxiWqFxqFfWHRQ4MijhYf7vVtX5PMz5cjL4PoOyqPLJTHTKne6pE/XqN1irjqUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org; spf=pass smtp.mailfrom=gnumonks.org; arc=none smtp.client-ip=213.95.27.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=netfilter.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gnumonks.org Received: from [78.30.33.11] (port=42844 helo=gnumonks.org) by ganesha.gnumonks.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rh7dA-00CFAm-GK; Mon, 04 Mar 2024 13:41:22 +0100 Date: Mon, 4 Mar 2024 13:41:19 +0100 From: Pablo Neira Ayuso To: Florian Westphal Cc: Lena Wang =?utf-8?B?KOeOi+WonCk=?= , "davem@davemloft.net" , "kadlec@netfilter.org" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "netfilter-devel@vger.kernel.org" Subject: Re: [PATCH net v2] netfilter: Add protection for bmp length out of range Message-ID: References: <20240302115241.GA7494@breakpoint.cc> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240302115241.GA7494@breakpoint.cc> X-Spam-Score: -1.9 (-) On Sat, Mar 02, 2024 at 12:52:41PM +0100, Florian Westphal wrote: > Pablo Neira Ayuso wrote: > > > + if (f->sz > 32) > > > + return H323_ERROR_RANGE; > > > > Could you possibly place this in get_bitmap()? IIRC these are the only > > two calls to this function. > > How would you signal the error? I think this patch is fine as-is. Provide the bitmap instead as parameter, but this opencode variant also LGTM, I am probably overdoing, we can take this as is. Thanks.