Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2828214pxb; Mon, 18 Apr 2022 09:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrMF/BurH+yzUDOWWW5OTljKb4vMU9lAhwWayN/GEZi/inNB/UqYvRH5Ux2xlbjoZ6IW7T X-Received: by 2002:a50:9986:0:b0:413:bbdd:d5a1 with SMTP id m6-20020a509986000000b00413bbddd5a1mr12947876edb.26.1650297898262; Mon, 18 Apr 2022 09:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650297898; cv=none; d=google.com; s=arc-20160816; b=P5n42bT0+jwBGSBsggBI8kPvZAy6aQDsnkElODSfgjGDT98WnyCfdoaRU7d7qKLaYn AxkLYZmhNakayAQzrukF/vauYCiajgbbF0q5kdv4l+XgsiAU/ghdwBZ5rhDJz+2fg/0o C/WA9KYXT2hQQINHKypgcOWFdQN0IXC7+05Bo6dACAJWPj7DwGYE5oxl45I09M36Qs1V +hpQ8q4W9RbL/Ts48ZDQBh4h6mBY3Q2dlTvGhWWxcG2eeJem9b6Uxm9hzBqXewyHZ80f dsYzFWFE1o5yb7gSvdz8+E2tOT8qD2nXcE5yErR1XkXb7sMRojucmNv3/2O2IXkXUn+0 0zzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+h8VfjKi+BNZIxTUVh3JrmPWE/qXG7Gh1OdYZ9//J40=; b=CxCPiWQD/z0UsTKYhLGgLD18OLPJAoGVSz26BqyBTw4QvdblGgXHTK9WWJOyotykIr ApSavXaElBxI3ns0rXM1jzoH3/u0XwkvhfywYIr+NhZLh2Rhc0GCf/+3N+50eqGcy/r4 VvFnILQANORFhce2AZAzSTp4SKP9Uo5q+XV5CBaVgSMasJshdDwEK4ORB2d+NAD7qbLI jajhnNxT2Gbdfgt0yAynSnY3/7w8RNwlHZ3NRMbyMTMhsonlUrN9Hlw2OUJ5xBlsn5XF V6mZNDWFbjO0VjTVxKz53kkv6cpSz6aI/kMUkn+sOcMyU2/Ma3hQ+J2gmWZldlTo6spQ bzVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xG3Ioe5u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eo12-20020a056402530c00b0042197f1fa72si5805771edb.253.2022.04.18.09.04.34; Mon, 18 Apr 2022 09:04:58 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xG3Ioe5u; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235056AbiDRMed (ORCPT + 99 others); Mon, 18 Apr 2022 08:34:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239181AbiDRM1u (ORCPT ); Mon, 18 Apr 2022 08:27:50 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6BB01EEFD; Mon, 18 Apr 2022 05:21:27 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E737FB80EDC; Mon, 18 Apr 2022 12:21:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 134B9C385A8; Mon, 18 Apr 2022 12:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1650284484; bh=Tz8etSiYKMM7cHcBHuerXjlDFxuy+vKXDjCA1BuI+eg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xG3Ioe5uyA4Wjt2g53MXx/9PLLNGDon2OU3OgW3t9ibAfgjCniWUARtDlMa6yr00x bMfesURg0pz6g1L3rjai31xxa9h36Ng53bTKJkYtlB4nGIKtLpWVmsejPC5QLnWRIi PGQgalmIhLR0Wdlmdsjnhj1fG8AQ3bRpVodi2TKU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Antoine Tenart , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 5.17 106/219] netfilter: nf_tables: nft_parse_register can return a negative value Date: Mon, 18 Apr 2022 14:11:15 +0200 Message-Id: <20220418121209.864337143@linuxfoundation.org> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220418121203.462784814@linuxfoundation.org> References: <20220418121203.462784814@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Antoine Tenart [ Upstream commit 6c6f9f31ecd47dce1d0dafca4bec8805f9bc97cd ] Since commit 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.") nft_parse_register can return a negative value, but the function prototype is still returning an unsigned int. Fixes: 6e1acfa387b9 ("netfilter: nf_tables: validate registers coming from userspace.") Signed-off-by: Antoine Tenart Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- net/netfilter/nf_tables_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index 1f5a0eece0d1..30d29d038d09 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9275,7 +9275,7 @@ int nft_parse_u32_check(const struct nlattr *attr, int max, u32 *dest) } EXPORT_SYMBOL_GPL(nft_parse_u32_check); -static unsigned int nft_parse_register(const struct nlattr *attr, u32 *preg) +static int nft_parse_register(const struct nlattr *attr, u32 *preg) { unsigned int reg; -- 2.35.1