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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8c38a9fe-8310-4903-7042-e8b5eb3b5f1b@arm.com>
Date:   Thu, 28 Mar 2019 16:59:17 +0530
From:   Amit Daniel Kachhap <amit.kachhap@....com>
To:     James Morse <james.morse@....com>,
        Kristina Martsenko <kristina.martsenko@....com>
Cc:     linux-arm-kernel@...ts.infradead.org,
        Christoffer Dall <christoffer.dall@....com>,
        Marc Zyngier <marc.zyngier@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will.deacon@....com>,
        Andrew Jones <drjones@...hat.com>,
        Dave Martin <Dave.Martin@....com>,
        Ramana Radhakrishnan <ramana.radhakrishnan@....com>,
        kvmarm@...ts.cs.columbia.edu, linux-kernel@...r.kernel.org,
        Mark Rutland <mark.rutland@....com>,
        Julien Thierry <julien.thierry@....com>
Subject: Re: [PATCH v7 7/10] KVM: arm/arm64: context-switch ptrauth registers


Hi James,
On 3/27/19 11:46 PM, James Morse wrote:
> Hi Amit, Kristina,
> 
> On 27/03/2019 03:21, Amit Daniel Kachhap wrote:
>> On 3/26/19 11:31 PM, Kristina Martsenko wrote:
>>> On 26/03/2019 04:03, Amit Daniel Kachhap wrote:
>>>> On 3/26/19 1:34 AM, Kristina Martsenko wrote:
>>>>> On 19/03/2019 08:30, Amit Daniel Kachhap wrote:
>>>>>> From: Mark Rutland <mark.rutland@....com>
>>>>>>
>>>>>> When pointer authentication is supported, a guest may wish to use it.
>>>>>> This patch adds the necessary KVM infrastructure for this to work, with
>>>>>> a semi-lazy context switch of the pointer auth state.
> 
>>>>>> +    if (test_bit(KVM_ARM_VCPU_PTRAUTH_ADDRESS, vcpu->arch.features) ||
>>>>>> +        test_bit(KVM_ARM_VCPU_PTRAUTH_GENERIC, vcpu->arch.features)) {>>>>> +        /* Verify that KVM startup matches the conditions for ptrauth */
>>>>>> +        if (WARN_ON(!vcpu_has_ptrauth(vcpu)))
>>>>>> +            return -EINVAL;
>>>>>> +    }
> 
>>> One more thing - I think the WARN_ON() here should be removed. Otherwise
>>> if panic_on_warn is set then userspace can panic the kernel. I think
>>> WARN_ON is only for internal kernel errors (see comment in
>>> include/asm-generic/bug.h).
>>
>> The documentation makes sense so in this case a pr_err like message will suffice.
> 
> (could it be a kvm_debug() at most?)
> 
> Do we need to print anything at all? User-space asked us for something we can't do.
> Filling up the kernel log with user-space's mistakes makes it harder to debug the kernel
> when something goes wrong.
> 
> kvm_arm_pmu_v3_init() returns -ENODEV if you ask if for the PMU and the platform can't
> support it. Isn't the returned error enough?
Yes Agree that most of the time the user invoked functions are just 
returned with error value in case of failure. Thanks for the details.

Regards,
Amit D
> 
> 
>> Btw
>> there is one WARN in the function kvm_set_ipa_limit in the same file.
> 
> That is called once via kvm_arch_init(), it can't be triggered repeatedly from user-space.
> 
> 
> Thanks,
> 
> James
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ