linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
       [not found] <20190627010137.5612-1-c0d1n61at3@gmail.com>
@ 2019-06-27  3:25 ` Jiunn Chang
  2019-06-27  3:32   ` Shuah Khan
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Jiunn Chang @ 2019-06-27  3:25 UTC (permalink / raw)
  To: skhan; +Cc: linux-kernel-mentees, netdev, linux-kernel, davem

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>
---
 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27  3:25 ` [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift Jiunn Chang
@ 2019-06-27  3:32   ` Shuah Khan
  2019-06-27 16:22     ` David Miller
  2019-06-27  5:04   ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
  2019-06-29 18:06   ` [Linux-kernel-mentees][PATCH v2] " David Miller
  2 siblings, 1 reply; 10+ messages in thread
From: Shuah Khan @ 2019-06-27  3:32 UTC (permalink / raw)
  To: Jiunn Chang
  Cc: linux-kernel-mentees, netdev, linux-kernel, davem,
	skh >> Shuah Khan

On 6/26/19 9:25 PM, Jiunn Chang wrote:
> 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
> 

These version change lines don't belong in the change log.

> Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
> ---

Move them here.

>   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
> 

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Linux-kernel-mentees][PATCH v3] packet: Fix undefined behavior in bit shift
  2019-06-27  3:25 ` [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift Jiunn Chang
  2019-06-27  3:32   ` Shuah Khan
@ 2019-06-27  5:04   ` Jiunn Chang
  2019-06-29 18:06   ` [Linux-kernel-mentees][PATCH v2] " David Miller
  2 siblings, 0 replies; 10+ messages in thread
From: Jiunn Chang @ 2019-06-27  5:04 UTC (permalink / raw)
  To: skhan; +Cc: linux-kernel-mentees, netdev, linux-kernel, davem

Shifting signed 32-bit value by 31 bits is undefined.  Changing most
significant bit to unsigned.

Signed-off-by: Jiunn Chang <c0d1n61at3@gmail.com>
---
Changes included in v3:
  - remove change log from patch description

Changes included in v2:
  - use subsystem specific subject lines
  - CC required mailing lists

 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27  3:32   ` Shuah Khan
@ 2019-06-27 16:22     ` David Miller
  2019-06-27 16:52       ` Shuah Khan
  2019-06-27 16:57       ` Jiunn Chang
  0 siblings, 2 replies; 10+ messages in thread
From: David Miller @ 2019-06-27 16:22 UTC (permalink / raw)
  To: skhan; +Cc: c0d1n61at3, linux-kernel-mentees, netdev, linux-kernel

From: Shuah Khan <skhan@linuxfoundation.org>
Date: Wed, 26 Jun 2019 21:32:52 -0600

> On 6/26/19 9:25 PM, Jiunn Chang wrote:
>> 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
>> 
> 
> These version change lines don't belong in the change log.

For networking changes I actually like the change lines to be in the
commit log.  So please don't stray people this way, thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27 16:22     ` David Miller
@ 2019-06-27 16:52       ` Shuah Khan
  2019-06-27 17:05         ` Alexei Starovoitov
  2019-06-27 16:57       ` Jiunn Chang
  1 sibling, 1 reply; 10+ messages in thread
From: Shuah Khan @ 2019-06-27 16:52 UTC (permalink / raw)
  To: David Miller
  Cc: c0d1n61at3, linux-kernel-mentees, netdev, linux-kernel, Shuah Khan

On 6/27/19 10:22 AM, David Miller wrote:
> From: Shuah Khan <skhan@linuxfoundation.org>
> Date: Wed, 26 Jun 2019 21:32:52 -0600
> 
>> On 6/26/19 9:25 PM, Jiunn Chang wrote:
>>> 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
>>>
>>
>> These version change lines don't belong in the change log.
> 
> For networking changes I actually like the change lines to be in the
> commit log.  So please don't stray people this way, thanks.
> 

As a general rule, please don't include change lines in the commit log.
For networking changes that get sent to David and netdev, as David
points out here, he likes them in the commit log, please include them
in the commit log.

I am working on FAQ (Frequently Answered Questions) section for mentees.
I will add this to it.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27 16:22     ` David Miller
  2019-06-27 16:52       ` Shuah Khan
@ 2019-06-27 16:57       ` Jiunn Chang
  2019-06-27 17:34         ` David Miller
  1 sibling, 1 reply; 10+ messages in thread
From: Jiunn Chang @ 2019-06-27 16:57 UTC (permalink / raw)
  To: David Miller; +Cc: skhan, linux-kernel-mentees, netdev, linux-kernel

On Thu, Jun 27, 2019 at 09:22:53AM -0700, David Miller wrote:
> From: Shuah Khan <skhan@linuxfoundation.org>
> Date: Wed, 26 Jun 2019 21:32:52 -0600
> 
> > On 6/26/19 9:25 PM, Jiunn Chang wrote:
> >> 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
> >> 
> > 
> > These version change lines don't belong in the change log.
> 
> For networking changes I actually like the change lines to be in the
> commit log.  So please don't stray people this way, thanks.

Hello David,

Would you like me to send v3 with the change log in the patch description?

I would be happy to do that.

THX,

Jiunn

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27 16:52       ` Shuah Khan
@ 2019-06-27 17:05         ` Alexei Starovoitov
  2019-06-27 17:08           ` Shuah Khan
  0 siblings, 1 reply; 10+ messages in thread
From: Alexei Starovoitov @ 2019-06-27 17:05 UTC (permalink / raw)
  To: Shuah Khan
  Cc: David Miller, c0d1n61at3, linux-kernel-mentees,
	Network Development, LKML

On Thu, Jun 27, 2019 at 9:54 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 6/27/19 10:22 AM, David Miller wrote:
> > From: Shuah Khan <skhan@linuxfoundation.org>
> > Date: Wed, 26 Jun 2019 21:32:52 -0600
> >
> >> On 6/26/19 9:25 PM, Jiunn Chang wrote:
> >>> 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
> >>>
> >>
> >> These version change lines don't belong in the change log.
> >
> > For networking changes I actually like the change lines to be in the
> > commit log.  So please don't stray people this way, thanks.
> >
>
> As a general rule, please don't include change lines in the commit log.
> For networking changes that get sent to David and netdev, as David
> points out here, he likes them in the commit log, please include them
> in the commit log.
>
> I am working on FAQ (Frequently Answered Questions) section for mentees.
> I will add this to it.

Same for bpf trees.
We prefer developers put as much as info as possible into commit logs
and cover letters.
Explanation of v1->v2->v3 differences is invaluable not only at
the point of code review, but in the future.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27 17:05         ` Alexei Starovoitov
@ 2019-06-27 17:08           ` Shuah Khan
  0 siblings, 0 replies; 10+ messages in thread
From: Shuah Khan @ 2019-06-27 17:08 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: David Miller, c0d1n61at3, linux-kernel-mentees,
	Network Development, LKML, Shuah Khan

On 6/27/19 11:05 AM, Alexei Starovoitov wrote:
> On Thu, Jun 27, 2019 at 9:54 AM Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 6/27/19 10:22 AM, David Miller wrote:
>>> From: Shuah Khan <skhan@linuxfoundation.org>
>>> Date: Wed, 26 Jun 2019 21:32:52 -0600
>>>
>>>> On 6/26/19 9:25 PM, Jiunn Chang wrote:
>>>>> 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
>>>>>
>>>>
>>>> These version change lines don't belong in the change log.
>>>
>>> For networking changes I actually like the change lines to be in the
>>> commit log.  So please don't stray people this way, thanks.
>>>
>>
>> As a general rule, please don't include change lines in the commit log.
>> For networking changes that get sent to David and netdev, as David
>> points out here, he likes them in the commit log, please include them
>> in the commit log.
>>
>> I am working on FAQ (Frequently Answered Questions) section for mentees.
>> I will add this to it.
> 
> Same for bpf trees.
> We prefer developers put as much as info as possible into commit logs
> and cover letters.
> Explanation of v1->v2->v3 differences is invaluable not only at
> the point of code review, but in the future.
> 

Thanks Alex. I will add that to the FAQ.

-- Shuah

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27 16:57       ` Jiunn Chang
@ 2019-06-27 17:34         ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2019-06-27 17:34 UTC (permalink / raw)
  To: c0d1n61at3; +Cc: skhan, linux-kernel-mentees, netdev, linux-kernel

From: Jiunn Chang <c0d1n61at3@gmail.com>
Date: Thu, 27 Jun 2019 11:57:28 -0500

> On Thu, Jun 27, 2019 at 09:22:53AM -0700, David Miller wrote:
>> From: Shuah Khan <skhan@linuxfoundation.org>
>> Date: Wed, 26 Jun 2019 21:32:52 -0600
>> 
>> > On 6/26/19 9:25 PM, Jiunn Chang wrote:
>> >> 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
>> >> 
>> > 
>> > These version change lines don't belong in the change log.
>> 
>> For networking changes I actually like the change lines to be in the
>> commit log.  So please don't stray people this way, thanks.
> 
> Hello David,
> 
> Would you like me to send v3 with the change log in the patch description?

I'll use v2 which had this done correctly.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift
  2019-06-27  3:25 ` [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift Jiunn Chang
  2019-06-27  3:32   ` Shuah Khan
  2019-06-27  5:04   ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
@ 2019-06-29 18:06   ` David Miller
  2 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2019-06-29 18:06 UTC (permalink / raw)
  To: c0d1n61at3; +Cc: skhan, linux-kernel-mentees, netdev, linux-kernel

From: Jiunn Chang <c0d1n61at3@gmail.com>
Date: Wed, 26 Jun 2019 22:25:30 -0500

> 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>

Applied.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-06-29 18:06 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190627010137.5612-1-c0d1n61at3@gmail.com>
2019-06-27  3:25 ` [Linux-kernel-mentees][PATCH v2] packet: Fix undefined behavior in bit shift Jiunn Chang
2019-06-27  3:32   ` Shuah Khan
2019-06-27 16:22     ` David Miller
2019-06-27 16:52       ` Shuah Khan
2019-06-27 17:05         ` Alexei Starovoitov
2019-06-27 17:08           ` Shuah Khan
2019-06-27 16:57       ` Jiunn Chang
2019-06-27 17:34         ` David Miller
2019-06-27  5:04   ` [Linux-kernel-mentees][PATCH v3] " Jiunn Chang
2019-06-29 18:06   ` [Linux-kernel-mentees][PATCH v2] " David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).