mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
kernel: audit: beautify code, for extern function, better to check its parameters by itself
__audit_socketcall is an extern function. better to check its parameters by itself. also can return error code, when fail (find invalid parameters). also use macro instead of real hard code number also give related comments for it. Signed-off-by: Chen Gang <gang.chen@asianux.com> [eparis: fix the return value when !CONFIG_AUDIT] Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
65ada7bc02
commit
2950fa9d32
3 changed files with 21 additions and 10 deletions
|
@ -2436,7 +2436,7 @@ static const unsigned char nargs[21] = {
|
|||
|
||||
SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
|
||||
{
|
||||
unsigned long a[6];
|
||||
unsigned long a[AUDITSC_ARGS];
|
||||
unsigned long a0, a1;
|
||||
int err;
|
||||
unsigned int len;
|
||||
|
@ -2452,7 +2452,9 @@ SYSCALL_DEFINE2(socketcall, int, call, unsigned long __user *, args)
|
|||
if (copy_from_user(a, args, len))
|
||||
return -EFAULT;
|
||||
|
||||
audit_socketcall(nargs[call] / sizeof(unsigned long), a);
|
||||
err = audit_socketcall(nargs[call] / sizeof(unsigned long), a);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
a0 = a[0];
|
||||
a1 = a[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue