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] [day] [month] [year] [list]
Message-ID: <35a53d53-5144-4a3d-9f59-beb84835eb3b@oracle.com>
Date: Tue, 25 Feb 2025 14:24:52 +0530
From: Sinadin Shan <sinadin.shan@...cle.com>
To: Chris Hyser <chris.hyser@...cle.com>,
        Shrikanth Hegde <sshegde@...ux.ibm.com>,
        "shuah@...nel.org"
 <shuah@...nel.org>
Cc: "linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] selftests: sched: skip cs_prctl_test for systems
 with core scheduling disabled



On 25-02-2025 04:32 am, Chris Hyser wrote:
>> From: Sinadin Shan <sinadin.shan@...cle.com>
>> Sent: Monday, February 24, 2025 7:10 AM
>> To: Shrikanth Hegde; shuah@...nel.org
>> Cc: linux-kselftest@...r.kernel.org; linux-kernel@...r.kernel.org; Chris Hyser
>> Subject: Re: [PATCH v2 2/2] selftests: sched: skip cs_prctl_test for systems with core scheduling disabled
>>
>> On 24-02-2025 01:49 pm, Shrikanth Hegde wrote:
> ...
>>> If the self-tests are to be used in development flow, these checks may
>>> not be sufficient.
>>
>> Right, this particular case was overlooked. To handle this, the test
>> could take a path to the custom config as an argument. I shall work on
>> getting this fixed.
> 
> I was thinking something along the lines of just calling the prctl.
> 
> If you call it and SCHED_CORE is not configured, you will get an EINVAL. Unfortunately,
> passing other bad values in the other prctl args will also give an EINVAL, but if you call it with a
> non-existent PID (say max_pid + 1) it will generate an ESRCH if the code is present.
> 
> So something like (and I'd look up the maxpid on the actual system):
> 
> int check_core_sched()
> {
>          ret = prctl(PR_SCHED_CORE, PR_SCHED_CORE_GET, 32769, PIDTYPE_PID,
>                           (unsigned long)&cookie);
> 
>          printf("ret = %d\n", ret);
>          perror("Error:\n");
> }
> 

Thanks for the suggestion Chris, this indeed would be a better method 
and also fit in well with the development workflow. I'll give this a try 
and send out the updated patch soon.

Regards,
Shan

> -chrish


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ