lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <09d1c410-5690-7158-8982-48ceec8ab64e@huawei.com>
Date:   Fri, 21 Oct 2022 20:23:12 +0800
From:   Tong Tiangen <tongtiangen@...wei.com>
To:     Palmer Dabbelt <palmer@...osinc.com>
CC:     <ajones@...tanamicro.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        <aou@...s.berkeley.edu>, <Conor.Dooley@...rochip.com>,
        <linux-riscv@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
        <wangkefeng.wang@...wei.com>, <guohanjun@...wei.com>
Subject: Re: [PATCH -next v2 2/2] riscv: extable: add new extable type
 EX_TYPE_KACCESS_ERR_ZERO support



在 2022/9/22 4:25, Palmer Dabbelt 写道:
> On Sat, 27 Aug 2022 03:39:38 PDT (-0700), tongtiangen@...wei.com wrote:
>>
>>
>> 在 2022/8/26 16:16, Andrew Jones 写道:
>>> On Fri, Aug 26, 2022 at 02:44:48PM +0800, Tong Tiangen wrote:
>>>>
>>>>
>>>> 在 2022/8/25 19:06, Andrew Jones 写道:
>>>>> On Mon, Aug 15, 2022 at 03:20:25AM +0000, Tong Tiangen wrote:
>>>>>> Currently, The extable type EX_TYPE_UACCESS_ERR_ZERO is used by
>>>>>> __get/put_kernel_nofault(), but those helpers are not uaccess 
>>>>>> type, so we
>>>>>> add a new extable type EX_TYPE_KACCESS_ERR_ZERO which can be used by
>>>>>> __get/put_kernel_no_fault().
>>>>>>
>>>>>> Only refactor code without any functional changes.
>>>>>
>>>>> This isn't quite true. __get/put_kernel_nofault now sets a different
>>>>> extable type (as the commit message says). But, nothing special seems
>>>>> to be done with that, so there's effectively no functional change. Can
>>>>> you please elaborate on the motivation for this change? Where will the
>>>>> KACCESS type need to be distinguished from the UACCESS type?
>>>>
>>>> The introduction of EX_TYPE_KACCESS_ERR_ZERO does not change any 
>>>> function,
>>>> but makes a correct distinction in the actual type, indicating that 
>>>> there
>>>> are indeed some kaccess entries in extable. I think this 
>>>> optimization is
>>>> more clear and reasonable.
>>>
>>> Well, creating new types, just for new type sake, just bloats code.
>>>
>>>>
>>>> A few weeks ago, I did something similar on arm64[1]. I think this
>>>> optimization can also be used on riscv.
>>>>
>>>> We can do some features that are used on uaccss but not applicable on
>>>> kaccess in the future[2].
>>>>
>>>> [1]
>>>> https://lore.kernel.org/lkml/20220621072638.1273594-2-tongtiangen@huawei.com/ 
>>>>
>>>> [2]https://lore.kernel.org/lkml/20220812070557.1028499-4-tongtiangen@huawei.com/ 
>>>>
>>>>
>>>
>>> This is part of the information, but I had already found this. What's
>>> still missing to me are the riscv patches, or at least a riscv plan, for
>>> actually implementing something which requires kaccess and uaccess to 
>>> have
>>> distinct types.
>>>
>>> Thanks,
>>> drew
>>
>> At present, there is no such plan on riscv, because it is rely on
>> hardware support.
>> I think this patch can be merged as a small code optimization and
>> without any function change.
> 
> Generally we need some use of the code in the upstream kernel to justify 
> its existence.  In this case I don't really see that: it's just another 
> type that's exactly the same as the existing one, having some out of 
> tree code that depends on making these types do something different 
> isn't a sufficient justification.
> .
Hi palmer:

I agree with this point very much,many thanks.

Tong.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ