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 B1D28C433FE for ; Mon, 10 Oct 2022 20:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230108AbiJJUp5 (ORCPT ); Mon, 10 Oct 2022 16:45:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230020AbiJJUpx (ORCPT ); Mon, 10 Oct 2022 16:45:53 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA15071725; Mon, 10 Oct 2022 13:45:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=WP+arezwzMwyESZqd4qvfOCY4eJDFC1RVVzNAdf/5TU=; b=3tOiE0txA95i+s3xZI0nMRB6ke FHWdPTXdqr6FshaW/lfrE8WM2Gubtyd8Odyyjy3m1MB4Djth5g/t7rvz8hS1qrgKe1w74Njarx8dF KyPHBYkLLCjlvEXJ2OUptpwVmw3OZ2oQsIHSBljJf8hyeFXmQieBNvrI+opj0a5scVHI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1ohzen-001ehQ-G5; Mon, 10 Oct 2022 22:45:49 +0200 Date: Mon, 10 Oct 2022 22:45:49 +0200 From: Andrew Lunn To: Andy Shevchenko Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Morton Subject: Re: [PATCH v1 1/1] mac_pton: Don't access memory over expected length Message-ID: References: <20221005164301.14381-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 10, 2022 at 11:29:37PM +0300, Andy Shevchenko wrote: > On Mon, Oct 10, 2022 at 10:19:49PM +0200, Andrew Lunn wrote: > > On Wed, Oct 05, 2022 at 07:43:01PM +0300, Andy Shevchenko wrote: > > > The strlen() may go too far when estimating the length of > > > the given string. In some cases it may go over the boundary > > > and crash the system which is the case according to the commit > > > 13a55372b64e ("ARM: orion5x: Revert commit 4904dbda41c8."). > > > > > > Rectify this by switching to strnlen() for the expected > > > maximum length of the string. > > > > This seems like something which should have a fixes: tag, and be > > against net, not net-next. > > I can (re-)send it that way. Just need a consensus by net maintainers. I would probably do: if (strnlen(s, maxlen) != maxlen) return false; I doubt anybody is removing leading zeros in MAC addresses. Andrew