Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5001162rwb; Tue, 8 Aug 2023 18:32:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEILfc2WubWe4kxbaD3wRVM9BKknsmnAOhpcWWMbsPhenuUswANEI7aL5VbNzznTX0FAIww X-Received: by 2002:a17:906:73dc:b0:99d:dfd:a5ba with SMTP id n28-20020a17090673dc00b0099d0dfda5bamr351694ejl.43.1691544730024; Tue, 08 Aug 2023 18:32:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691544730; cv=none; d=google.com; s=arc-20160816; b=VYLkHi9PqoIso5hcFKZjQQxUGRdmZIe99q//jOKQodj1Jrv2ZrUWgDl+/vj9RnVuj6 CNYp2lRIXzzKe+CwoMw2Zy9KscbJ9e4ngo5bUh4Vwfji8O6aCRyuVJ+Nui1q+9KDYK5q geBWQjUbwKxjjIxsERvKR1Gtl58s3K+QfAQheMcHc+ytOFBYO7FUvV7YsI9uylDvF4I/ +UwmF0Kecmw2rphoQ62YnnmwjYpiMmIYZGMotjlUB9UiDG1QvuuJqF1zKiZKYB0/HQcm VYWjQZ2Bf4K58bIB3DQmxZd8Gr31LEUipg2kXNhtvT7myIMjKIxmf6vo0tPLKLx5TWF0 osaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ixM0CwOxaeboCCs0K2xULiZF7ZtHMTDYbyjQAMQ/vt4=; fh=q+idgjsNOfSeB0DE+ldLVkxZV9h+m6OLm8KWzgZjrCg=; b=d4/Y4qOmaiaGKGZ392baqO5jL1/CDZQbRS6nZ5gSM0F0j4dKh6ZRPBctnt+U3NfFdl 9LtJ0X5LUaoWuy3kRF0myhUzSGfE9JEsAPSgMYQE5teBz4yjLlngWuKPy/oKcF9KkANf ZeAH2/9JuLO17tE1x8qPz8aAfE7pHUEGTrlNOYcdhsdxyg5Z5ywcYfsyVBzdXqNPXsN/ Jc3+ytB8AgUZgwaXg/7zOOX0MCMsHzeQU1JXUHDyoQ45pXI5FOvMCCr6ctLDdAITsIhM /5jRAvRy0WFSP8NfiFA2UT7KERMrL5lMZ1VEUQf8eaiRg7enF4KxjytcufFucraxsY1a YUiQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jt18-20020a170906dfd200b0099c9e68e3b4si7033187ejc.325.2023.08.08.18.31.46; Tue, 08 Aug 2023 18:32:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229775AbjHHXjH (ORCPT + 99 others); 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 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 },