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 D8625C41513 for ; Tue, 8 Aug 2023 23:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230459AbjHHXjH (ORCPT ); Tue, 8 Aug 2023 19:39:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231258AbjHHXjG (ORCPT ); Tue, 8 Aug 2023 19:39:06 -0400 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [IPv6:2a0a:51c0:0:237:300::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F9E1BFE; Tue, 8 Aug 2023 16:39:02 -0700 (PDT) Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1qTWHv-0005Zw-9W; Wed, 09 Aug 2023 01:38:55 +0200 Date: Wed, 9 Aug 2023 01:38:55 +0200 From: Florian Westphal To: Justin Stitt Cc: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-hardening@vger.kernel.org, Kees Cook , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/7] netfilter: ipset: refactor deprecated strncpy Message-ID: <20230808233855.GI9741@breakpoint.cc> References: <20230808-net-netfilter-v1-0-efbbe4ec60af@google.com> <20230808-net-netfilter-v1-1-efbbe4ec60af@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230808-net-netfilter-v1-1-efbbe4ec60af@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Justin Stitt wrote: > Fixes several buffer overread bugs present in `ip_set_core.c` by using > `strscpy` over `strncpy`. > > Link: https://github.com/KSPP/linux/issues/90 > Cc: linux-hardening@vger.kernel.org > Signed-off-by: Justin Stitt > > --- > There exists several potential buffer overread bugs here. These bugs > exist due to the fact that the destination and source strings may have > the same length which is equal to the max length `IPSET_MAXNAMELEN`. There is no truncation. Inputs are checked via nla_policy: [IPSET_ATTR_SETNAME2] = { .type = NLA_NUL_STRING, .len = IPSET_MAXNAMELEN - 1 },