[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57ce7089-37c7-44c5-a9da-5a6f02794c42@I-love.SAKURA.ne.jp>
Date: Sat, 23 Dec 2023 19:48:58 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: Paul Moore <paul@...l-moore.com>, Alfred Piccioni <alpic@...gle.com>
Cc: Stephen Smalley <stephen.smalley.work@...il.com>,
Eric Paris <eparis@...isplace.org>,
linux-security-module@...r.kernel.org, linux-fsdevel@...r.kernel.org,
stable@...r.kernel.org, selinux@...r.kernel.org,
linux-kernel@...r.kernel.org, Casey Schaufler <casey@...aufler-ca.com>
Subject: Re: [PATCH] security: new security_file_ioctl_compat() hook
On 2023/12/23 10:23, Paul Moore wrote:
>> - /* RED-PEN how should LSM module know it's handling 32bit? */
>> - error = security_file_ioctl(f.file, cmd, arg);
>> + error = security_file_ioctl_compat(f.file, cmd, arg);
>> if (error)
>> goto out;
>
> This is interesting ... if you look at the normal ioctl() syscall
> definition in the kernel you see 'ioctl(unsigned int fd, unsigned int
> cmd, unsigned long arg)' and if you look at the compat definition you
> see 'ioctl(unsigned int fd, unsigned int cmd, compat_ulong_t arg)'. I
> was expecting the second parameter, @cmd, to be a long type in the
> normal definition, but it is an int type in both cases. It looks like
> it has been that way long enough that it is correct, but I'm a little
> lost ...
Since @arg might be a pointer to some struct, @arg needs to use a long type.
But @cmd can remain 32bits for both 32bits/64bits kernels because @cmd is not
a pointer, can't it?
> I agree that it looks like Smack and TOMOYO should be fine, but I
> would like to hear from Casey and Tetsuo to confirm.
Fine for TOMOYO part, for TOMOYO treats @cmd as an integer.
Powered by blists - more mailing lists