From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Cyril Bur <cyrilbur@tenstorrent.com>,
Charlie Jenkins <charlie@rivosinc.com>
Cc: palmer@dabbelt.com, aou@eecs.berkeley.edu,
paul.walmsley@sifive.com, linux-riscv@lists.infradead.org,
linux-kernel@vger.kernel.org, Jisheng Zhang <jszhang@kernel.org>
Subject: Re: [PATCH v2 1/4] riscv: implement user_access_begin and families
Date: Thu, 13 Feb 2025 17:16:05 +0000 [thread overview]
Message-ID: <a994e94c-3211-4bb4-ab41-71a2c1abebd4@codethink.co.uk> (raw)
In-Reply-To: <e4a4c688-b78c-468b-8196-68d2df980167@tenstorrent.com>
On 13/02/2025 17:07, Cyril Bur wrote:
>
>
> On 6/2/2025 1:08 am, Ben Dooks wrote:
>> On 17/01/2025 23:21, Charlie Jenkins wrote:
>>> On Mon, Nov 18, 2024 at 11:01:09PM +0000, Cyril Bur wrote:
>>>> From: Jisheng Zhang <jszhang@kernel.org>
>>>>
>>>> Currently, when a function like strncpy_from_user() is called,
>>>> the userspace access protection is disabled and enabled
>>>> for every word read.
>>>>
>>>> By implementing user_access_begin and families, the protection
>>>> is disabled at the beginning of the copy and enabled at the end.
>>>>
>>>> The __inttype macro is borrowed from x86 implementation.
>>>>
>>>> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>>>> Signed-off-by: Cyril Bur <cyrilbur@tenstorrent.com>
>>
>> If we're doing this, then saving the STATUS.SUM flag is going to
>> be more important than before. We had this discussion when the
>> initial user-access with syzbot stress testing turned up.
>>
>> We partially fixed this by rewriting the ordering in the __put_user
>> function to stop the 'x' argument being evaluated inside the area
>> where SUM is enabled, but this is going to make the window of
>> opportunity of a thread switch much bigger and the bug will just
>> come back and bite harder.
>>
>> If you want I can look at re-doing my original patch and resubmitting.
>
> Oh! Could you please link the patch? I haven't seen it and can't seem to
> find it now.
https://lore.kernel.org/linux-riscv/20210318151010.100966-1-ben.dooks@codethink.co.uk/
> Thanks.
>
>>
>>
>
>
--
Ben Dooks http://www.codethink.co.uk/
Senior Engineer Codethink - Providing Genius
https://www.codethink.co.uk/privacy.html
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2025-02-13 18:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 23:01 [PATCH v2 0/4] riscv: uaccess: optimizations Cyril Bur
2024-11-18 23:01 ` [PATCH v2 1/4] riscv: implement user_access_begin and families Cyril Bur
2025-01-17 23:21 ` Charlie Jenkins
2025-02-05 15:08 ` Ben Dooks
2025-02-13 17:07 ` Cyril Bur
2025-02-13 17:16 ` Ben Dooks [this message]
2025-02-18 19:21 ` Cyril Bur
2024-11-18 23:01 ` [PATCH v2 2/4] riscv: uaccess: use input constraints for ptr of __put_user Cyril Bur
2025-01-17 23:23 ` Charlie Jenkins
2025-01-17 23:34 ` Jessica Clarke
2025-01-31 1:31 ` Cyril Bur
2025-01-31 6:00 ` Charlie Jenkins
2024-11-18 23:01 ` [PATCH v2 3/4] riscv: uaccess: use 'asm goto' for put_user() Cyril Bur
2025-01-17 23:24 ` Charlie Jenkins
2024-11-18 23:01 ` [PATCH v2 4/4] riscv: uaccess: use 'asm goto output' for get_user Cyril Bur
2025-01-17 23:24 ` Charlie Jenkins
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=a994e94c-3211-4bb4-ab41-71a2c1abebd4@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=aou@eecs.berkeley.edu \
--cc=charlie@rivosinc.com \
--cc=cyrilbur@tenstorrent.com \
--cc=jszhang@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
/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