Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1744938ybl; Sat, 11 Jan 2020 01:58:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwGsjq8wG/xkp5zdFfzbmCaskd9lm5VopBZrDwLtPQoQh8lQ/jZ42rlSIBXxIbTygolyIwK X-Received: by 2002:a05:6830:1515:: with SMTP id k21mr5777974otp.177.1578736700815; Sat, 11 Jan 2020 01:58:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578736700; cv=none; d=google.com; s=arc-20160816; b=kWlko3M6S2/VnOBFlYRgT/jrSWksqNY2+Q+xGrMYqog5L+G+6zsOuaovDPQRfyWGS+ XKr3n16dF3wSXpd/qtrveSFUpbeNUtRzsdf95QDBKGin+OkADpfAULGqViIBcVqd1Aw5 V+p11lFUgOZ5PzA9i72BQEn1JqXr0T8+XT00dVOIBvg2ClCHHL6SwYgsPk4vnY3MVEy5 kTyZp36o6k9lkjNFdgG3vmDOa1kPwaqu5emhGsqNb+gyUxI+gHZ5FhQ4J9f9B7udTVd8 1ZOkhgv+2OE2XuKJrMjFh4LTMCuQCFUDdFALILZQ1mUFJMahhpCJkyabHiDsrHgMzYBp qpbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qnt+y5H9XL9U+XZlxiAZ0tFoyk9we6jbBuEMCVARRzU=; b=kZcFjrlDZX5y1fOE3VeweDITfgYoVIKs/lhx6bAJ1uiArC+n286sWq4OFpvmjotr2/ +hqufMH3POMb7GkP/GrZw2lqZnK/kiZm6YIO4P4c6mliqJZMDPgQLXKFUl451Ex6bYvU xUz6NZrFoIIuSMHRzMxF0eoWu8KAYKDBq5Fsu+dnUCAJPrHdMVY0vivDpmMsJDsHYnBn hUIoYOTHEr9a4Y0Fd2KBMHN5kehp1njC6Rd44JTJplsfCe4JkJ6n5HQLyT2crDlj+0pP 7j2FM5rX2Y2CZs6Ac5+daHnvHvVbhKik8N3+CX4vXM6DPLTe2PBUq7zh5q5F5gt9oGUx hkQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hVGYQCZT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v145si2833135oia.68.2020.01.11.01.58.09; Sat, 11 Jan 2020 01:58:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hVGYQCZT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729146AbgAKJ5I (ORCPT + 99 others); Sat, 11 Jan 2020 04:57:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:48988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728808AbgAKJ5H (ORCPT ); Sat, 11 Jan 2020 04:57:07 -0500 Received: from localhost (unknown [62.119.166.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD0EC2064C; Sat, 11 Jan 2020 09:57:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578736626; bh=NNw99yDgnomHEX/wiCHt4g48oPdJlqmY2MfUhjGVdfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hVGYQCZTAFdhmZH54lpZOY+X+nUwQiHyZuL7Nt2BTbZFiuEJ+d0q0H5D805+QzI/f 5ZVUbDa7OqrIO34BcEdGBTnsQAnqfPRkqnzIRdxC+AH1/JajwCneZ1o1vDk+BfFCf3 Sq839R9fYJ9Dk8vEG6DyUxdg8kKt02Zpj6DOkwyQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Sutter , Pablo Neira Ayuso , Sasha Levin Subject: [PATCH 4.4 37/59] netfilter: uapi: Avoid undefined left-shift in xt_sctp.h Date: Sat, 11 Jan 2020 10:49:46 +0100 Message-Id: <20200111094845.609038605@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200111094835.417654274@linuxfoundation.org> References: <20200111094835.417654274@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phil Sutter [ Upstream commit 164166558aacea01b99c8c8ffb710d930405ba69 ] With 'bytes(__u32)' being 32, a left-shift of 31 may happen which is undefined for the signed 32-bit value 1. Avoid this by declaring 1 as unsigned. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso Signed-off-by: Sasha Levin --- include/uapi/linux/netfilter/xt_sctp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/netfilter/xt_sctp.h b/include/uapi/linux/netfilter/xt_sctp.h index 29287be696a2..788b77c347a0 100644 --- a/include/uapi/linux/netfilter/xt_sctp.h +++ b/include/uapi/linux/netfilter/xt_sctp.h @@ -40,19 +40,19 @@ struct xt_sctp_info { #define SCTP_CHUNKMAP_SET(chunkmap, type) \ do { \ (chunkmap)[type / bytes(__u32)] |= \ - 1 << (type % bytes(__u32)); \ + 1u << (type % bytes(__u32)); \ } while (0) #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ do { \ (chunkmap)[type / bytes(__u32)] &= \ - ~(1 << (type % bytes(__u32))); \ + ~(1u << (type % bytes(__u32))); \ } while (0) #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ ({ \ ((chunkmap)[type / bytes (__u32)] & \ - (1 << (type % bytes (__u32)))) ? 1: 0; \ + (1u << (type % bytes (__u32)))) ? 1: 0; \ }) #define SCTP_CHUNKMAP_RESET(chunkmap) \ -- 2.20.1