Skip to content

Commit

Permalink
packet: Fix undefined behavior in bit shift
Browse files Browse the repository at this point in the history
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 <c0d1n61at3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jiunn Chang authored and davem330 committed Jun 29, 2019
1 parent b60a773 commit 79293f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/uapi/linux/if_packet.h
Expand Up @@ -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
Expand Down

0 comments on commit 79293f4

Please sign in to comment.