Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1552101ybd; Wed, 26 Jun 2019 20:26:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQUldRmHX8FQcPyeRFB8OdYLvo6zsuFbRjfKjf1876B6oDrUB70+5gTHpHgS4kLneEtZKy X-Received: by 2002:a17:902:4683:: with SMTP id p3mr1748759pld.31.1561605967035; Wed, 26 Jun 2019 20:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561605967; cv=none; d=google.com; s=arc-20160816; b=tf7V6NEV2aO93R3bX48c9YfY1PyOmITvG+f8Q+dfymDEw4ibuMMeL3LHm9Gw/LbVHm WDxqdfc0Sd6DfOoJ+T7ZnrOCKafNX01TfIDXrO6VnMiBHMkmVhmRDvm7+1RInC2Ol6Y1 0YQ1eWMtb3Zyij7maKDXD4Tt+WWb30Q3RpUzmGPJMXffLTcpcTxZSBoKd39bgvi+V0aj hLL2FnDVNOCoCxZB1tMRIeOZQcjEZpcjieaBUFBSEKJypHYz+hQzXXQ2qDraePpNS4TJ FreEGpW7grpoUa2rs2QRICQAw97GqVnsd80sEjX2QCXUelciAGMOeLBmM+KYwearklVw NZIA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jqnuOLrtXSxBh9hzF7jl+szgxHyLui5g61Cb7nScCKA=; b=EFyECqfDDTumT0lkOGXvBSZUNhJuyUrRAgC2+07020BVzF3zDZMvlByMWVD+3xNJqZ kfJvJ0o+3hwb9aro22L0qFM/d3+CWJgwqRbulwlumPv8sBUh7JNYvwC/v251TANLRnWT NoHFM8FxgiDUHPs+1IcBaIeYLsRomZWLpnTKrLyBlt58DGDKB8G61n9fuKpF7yYEcd1H BypjiHRafOqV9r2dlQaTBMAST2MfdCCcI6qM3X3eQ5Jss3iWRcPsj50Aw94usxk0hr3o wXklHXjvvJl4/VioqSWVE+4S54Q2aF3j1rGbtKg/ZOLmZu0ZvTKLF3CMxVmU7JvqF1zz PPuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=khQH0XHC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si1052767plp.329.2019.06.26.20.25.45; Wed, 26 Jun 2019 20:26:07 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=khQH0XHC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726880AbfF0DZj (ORCPT + 99 others); Wed, 26 Jun 2019 23:25:39 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:43722 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbfF0DZf (ORCPT ); Wed, 26 Jun 2019 23:25:35 -0400 Received: by mail-oi1-f194.google.com with SMTP id w79so469906oif.10; Wed, 26 Jun 2019 20:25:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jqnuOLrtXSxBh9hzF7jl+szgxHyLui5g61Cb7nScCKA=; b=khQH0XHCz8+7FsjpBdLjGgP/cd3kzdgonClS6lPvKNmjTBIb/hCrTRB6vqh5zRbbXf l+ed1UvXS1vLNshz4JL78W2G/Bxj8ZAI8JXY3ub9zGYr7We9m2UJvOsKlrLszuMK8i5X GZ5KDu4oeuphPMv/FL/bJfpczk4P1HBBvMHOA6TZIgaWlbhMzuQeYbdSf+FVcmyTPi6W cTpAVx+R+ALQPnTK1CjhHX7YMBhBZVyh7LiKMIJoJyqqNHpm0k3UIq+39c4agNzgr30d e6HiFXxYbWg8+jiwGiU4usAHGyc90/tb1vwLfxgqcCL3dWd7yqOta+BcaZDAqEi6++Tj AMdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jqnuOLrtXSxBh9hzF7jl+szgxHyLui5g61Cb7nScCKA=; b=b8hUV3x1HFYhUVMzte3sWXsFBSeIRGUDxClRliYs3sLrB8pYJuUD0TLc6VTDdh9Bhm aTbpDe6i0jjzI0mpTfKh/x5GE96561Ay+GEtlHckocWrKKM7Av/iYfRjhlf8dgeJoyHa Y7BSA6brsfU3BNBuR0Bfjfjubl43ZsVbabhBwmVHVo++9BebXp7psY2xB5lzv3PsP/5+ gWES26SdyQD7E56pjwJVRSjQiJJuxv+aaHm53/i4uaAUsLuWESSI6Fh8eL+RXlNsjL/H rp3XYbU+D1bnWVN1oEFgi/boSdNfF7AQfGSOGsgsbvbs2/EdyPTB5XJu7xAzz6/NnHCg QG+w== X-Gm-Message-State: APjAAAXJzfHIQPeWga5c/2vBI0gagWVsq/DGXoJrT1zMQtf17u/n/U3x 8QYwHXIbpWUQooYDMNZYi28EbHwMNDw= X-Received: by 2002:aca:f003:: with SMTP id o3mr979227oih.59.1561605934928; Wed, 26 Jun 2019 20:25:34 -0700 (PDT) Received: from rYz3n.attlocal.net ([2600:1700:210:3790::48]) by smtp.googlemail.com with ESMTPSA id y184sm417647oie.33.2019.06.26.20.25.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 26 Jun 2019 20:25:34 -0700 (PDT) From: Jiunn Chang To: skhan@linuxfoundation.org Cc: linux-kernel-mentees@lists.linuxfoundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, davem@davemloft.net Subject: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift Date: Wed, 26 Jun 2019 22:25:30 -0500 Message-Id: <20190627032532.18374-2-c0d1n61at3@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190627010137.5612-1-c0d1n61at3@gmail.com> References: <20190627010137.5612-1-c0d1n61at3@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shifting signed 32-bit value by 31 bits is undefined. Changing most significant bit to unsigned. Changes included in v2: - use subsystem specific subject lines - CC required mailing lists Signed-off-by: Jiunn Chang --- include/uapi/linux/if_packet.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index 467b654bd4c7..3d884d68eb30 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h @@ -123,7 +123,7 @@ struct tpacket_auxdata { /* Rx and Tx ring - header status */ #define TP_STATUS_TS_SOFTWARE (1 << 29) #define TP_STATUS_TS_SYS_HARDWARE (1 << 30) /* deprecated, never set */ -#define TP_STATUS_TS_RAW_HARDWARE (1 << 31) +#define TP_STATUS_TS_RAW_HARDWARE (1U << 31) /* Rx ring - feature request bits */ #define TP_FT_REQ_FILL_RXHASH 0x1 -- 2.22.0