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: <a9d142c9-8a61-ee59-d849-393af1b3eaec@marek.ca>
Date:   Mon, 7 Sep 2020 09:51:13 -0400
From:   Jonathan Marek <jonathan@...ek.ca>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     linux-arm-msm@...r.kernel.org, Arnd Bergmann <arnd@...db.de>,
        Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@...aro.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] misc: fastrpc: add ioctl for attaching to sensors pd

On 9/7/20 8:33 AM, Greg Kroah-Hartman wrote:
> On Mon, Aug 31, 2020 at 08:32:59PM -0400, Jonathan Marek wrote:
>> Initializing sensors requires attaching to pd 2. Add an ioctl for that.
>>
>> This corresponds to FASTRPC_INIT_ATTACH_SENSORS in the downstream driver.
>>
>> Signed-off-by: Jonathan Marek <jonathan@...ek.ca>
>> ---
>>   drivers/misc/fastrpc.c      | 9 ++++++---
>>   include/uapi/misc/fastrpc.h | 5 +++--
>>   2 files changed, 9 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
>> index 7939c55daceb..ea5e9ca0d705 100644
>> --- a/drivers/misc/fastrpc.c
>> +++ b/drivers/misc/fastrpc.c
>> @@ -1276,7 +1276,7 @@ static int fastrpc_dmabuf_alloc(struct fastrpc_user *fl, char __user *argp)
>>   	return 0;
>>   }
>>   
>> -static int fastrpc_init_attach(struct fastrpc_user *fl)
>> +static int fastrpc_init_attach(struct fastrpc_user *fl, int pd)
>>   {
>>   	struct fastrpc_invoke_args args[1];
>>   	int tgid = fl->tgid;
>> @@ -1287,7 +1287,7 @@ static int fastrpc_init_attach(struct fastrpc_user *fl)
>>   	args[0].fd = -1;
>>   	args[0].reserved = 0;
>>   	sc = FASTRPC_SCALARS(FASTRPC_RMID_INIT_ATTACH, 1, 0);
>> -	fl->pd = 0;
>> +	fl->pd = pd;
>>   
>>   	return fastrpc_internal_invoke(fl, true, FASTRPC_INIT_HANDLE,
>>   				       sc, &args[0]);
>> @@ -1477,7 +1477,10 @@ static long fastrpc_device_ioctl(struct file *file, unsigned int cmd,
>>   		err = fastrpc_invoke(fl, argp);
>>   		break;
>>   	case FASTRPC_IOCTL_INIT_ATTACH:
>> -		err = fastrpc_init_attach(fl);
>> +		err = fastrpc_init_attach(fl, 0);
>> +		break;
>> +	case FASTRPC_IOCTL_INIT_ATTACH_SNS:
>> +		err = fastrpc_init_attach(fl, 2);
> 
> Shouldn't you have #defines for those magic numbers somewhere?  What
> does 0 and 2 mean?
> 

This is based off a downstream driver which also uses magic numbers, 
although I can make an educated guess about the meaning.

Srini do you have any suggestions for how to name these values?

> thanks,
> 
> greg k-h
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ