From: Shuah Khan <skhan@linuxfoundation.org>
To: Kees Cook <keescook@chromium.org>, Greg KH <gregkh@linuxfoundation.org>
Cc: corbet@lwn.net, peterz@infradead.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 01/13] seqnum_ops: Introduce Sequence Number Ops
Date: Wed, 11 Nov 2020 12:23:03 -0700 [thread overview]
Message-ID: <3075a4fd-8615-1459-2b20-b7d9d2be34ff@linuxfoundation.org> (raw)
In-Reply-To: <202011101614.E7D880689@keescook>
On 11/10/20 5:18 PM, Kees Cook wrote:
> On Tue, Nov 10, 2020 at 09:43:02PM +0100, Greg KH wrote:
>> On Tue, Nov 10, 2020 at 09:41:40PM +0100, Greg KH wrote:
>>> On Tue, Nov 10, 2020 at 12:53:27PM -0700, Shuah Khan wrote:
>>>> +Decrement interface
>>>> +-------------------
>>>> +
>>>> +Decrements sequence number and doesn't return the new value. ::
>>>> +
>>>> + seqnum32_dec() --> atomic_dec()
>>>> + seqnum64_dec() --> atomic64_dec()
>>>
>>> Why would you need to decrement a sequence number? Shouldn't they just
>>> always go up?
>>>
>>> I see you use them in your patch 12/13, but I don't think that really is
>>> a sequence number there, but rather just some other odd value :)
>
> To that end, they should likely be internally cast to u32 and u64 (and
> why is seqnum64 ifdef on CONFIG_64BIT?).
>
I had a reason for doing this, can't recall. I will revisit and remove
it which is ideal. I have to look at CONFIG_GENERIC_ATOMIC64 as well.
Not seeing any errors with my config which has CONFIG_64BIT=y
>> Note, other than this, I like the idea. It makes it obvious what these
>> atomic variables are being used for, and they can't be abused for other
>> things. Nice work.
>
Thanks.
> Agreed: this is a clear wrapping sequence counter. It's only abuse would
> be using it in a place where wrapping actually is _not_ safe. (bikeshed:
> can we call it wrap_u32 and wrap_u64?)
>
Still like seqnum_ops.
There is seqcount_t in seqlock.h which is a totally different feature.
thanks,
-- Shuah
next prev parent reply other threads:[~2020-11-11 19:23 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 19:53 [PATCH 00/13] Introduce seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 01/13] seqnum_ops: Introduce Sequence Number Ops Shuah Khan
2020-11-10 20:41 ` Greg KH
2020-11-10 20:43 ` Greg KH
2020-11-11 0:18 ` Kees Cook
2020-11-11 19:23 ` Shuah Khan [this message]
2020-11-12 12:36 ` Matthew Wilcox
2020-11-12 16:17 ` Shuah Khan
2020-11-12 16:45 ` Greg KH
2020-11-12 16:59 ` Shuah Khan
2020-11-12 21:27 ` Shuah Khan
2020-11-17 12:27 ` Peter Zijlstra
2020-11-10 21:03 ` Matthew Wilcox
2020-11-10 22:58 ` Shuah Khan
2020-11-11 0:20 ` Kees Cook
2020-11-11 15:42 ` Shuah Khan
2020-11-11 8:23 ` Peter Zijlstra
2020-11-11 15:56 ` Shuah Khan
2020-11-11 16:04 ` Peter Zijlstra
2020-11-11 17:34 ` Shuah Khan
2020-11-11 17:50 ` Peter Zijlstra
2020-11-11 18:28 ` Shuah Khan
2020-11-11 20:15 ` Peter Zijlstra
2020-11-12 13:29 ` Greg KH
2020-11-10 19:53 ` [PATCH 02/13] selftests:lib:test_seqnum_ops: add new test for seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 03/13] drivers/acpi: convert seqno seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 04/13] drivers/acpi/apei: convert seqno to seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 05/13] drivers/base/test/test_async_driver_probe: convert to use seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 06/13] drivers/char/ipmi: convert stats " Shuah Khan
2020-11-10 19:53 ` [PATCH 07/13] drivers/edac: convert pci counters to seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 08/13] drivers/oprofile: convert stats to use seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 09/13] drivers/staging/rtl8723bs: " Shuah Khan
2020-11-10 19:53 ` [PATCH 10/13] usb: usbip/vhci: convert seqno to seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 11/13] drivers/staging/rtl8188eu: convert stats to use seqnum_ops Shuah Khan
2020-11-10 19:53 ` [PATCH 12/13] drivers/staging/unisys/visorhba: " Shuah Khan
2020-11-10 20:42 ` Greg KH
2020-11-10 21:02 ` Shuah Khan
2020-11-10 19:53 ` [PATCH 13/13] security/integrity/ima: converts stats to seqnum_ops Shuah Khan
2020-11-10 20:44 ` [PATCH 00/13] Introduce seqnum_ops Alan Stern
2020-11-10 22:42 ` Shuah Khan
2020-11-11 4:33 ` Matthew Wilcox
2020-11-11 16:03 ` Shuah Khan
2020-11-11 16:41 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3075a4fd-8615-1459-2b20-b7d9d2be34ff@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=corbet@lwn.net \
--cc=gregkh@linuxfoundation.org \
--cc=keescook@chromium.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).