Revert "linux: implement fchmodat2 syscall"

This got accidentally committed when I was reverting another commit.

This reverts commit c070ec923e.
This commit is contained in:
Enji Cooper committed 2026-10-05 21:51:35 -07:00
1 parent 32f5a9f3fb
commit 4abfb452ea
14 files changed
+20 -136

No files matched your search

+2 -5
View File
@@ -1436,10 +1436,7 @@ struct linux_cachestat_args {
syscallarg_t dummy;
};
struct linux_fchmodat2_args {
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)];
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
syscallarg_t dummy;
};
struct linux_map_shadow_stack_args {
syscallarg_t dummy;
@@ -2062,7 +2059,7 @@ int linux_map_shadow_stack(struct thread *, struct linux_map_shadow_stack_args *
#define LINUX_SYS_AUE_linux_futex_waitv AUE_NULL
#define LINUX_SYS_AUE_linux_set_mempolicy_home_node AUE_NULL
#define LINUX_SYS_AUE_linux_cachestat AUE_NULL
#define LINUX_SYS_AUE_linux_fchmodat2 AUE_FCHMODAT
#define LINUX_SYS_AUE_linux_fchmodat2 AUE_NULL
#define LINUX_SYS_AUE_linux_map_shadow_stack AUE_NULL
#undef PAD_
+1 -1
View File
@@ -466,6 +466,6 @@ struct sysent linux_sysent[] = {
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_futex_waitv, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 449 = linux_futex_waitv */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_set_mempolicy_home_node, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 450 = linux_set_mempolicy_home_node */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_cachestat, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 451 = linux_cachestat */
{ .sy_narg = AS(linux_fchmodat2_args), .sy_call = (sy_call_t *)linux_fchmodat2, .sy_auevent = AUE_FCHMODAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 452 = linux_fchmodat2 */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_fchmodat2, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 452 = linux_fchmodat2 */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_map_shadow_stack, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 453 = linux_map_shadow_stack */
};
+1 -25
View File
@@ -2806,12 +2806,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_fchmodat2 */
case 452: {
struct linux_fchmodat2_args *p = params;
iarg[a++] = p->dfd; /* l_int */
uarg[a++] = (intptr_t)p->filename; /* const char * */
iarg[a++] = p->mode; /* l_mode_t */
iarg[a++] = p->flags; /* l_int */
*n_args = 4;
*n_args = 0;
break;
}
/* linux_map_shadow_stack */
@@ -7303,22 +7298,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_fchmodat2 */
case 452:
switch (ndx) {
case 0:
p = "l_int";
break;
case 1:
p = "userland const char *";
break;
case 2:
p = "l_mode_t";
break;
case 3:
p = "l_int";
break;
default:
break;
};
break;
/* linux_map_shadow_stack */
case 453:
@@ -8848,9 +8827,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 451:
/* linux_fchmodat2 */
case 452:
if (ndx == 0 || ndx == 1)
p = "int";
break;
/* linux_map_shadow_stack */
case 453:
default:
+2 -7
View File
@@ -2188,13 +2188,8 @@
int linux_cachestat(void);
}
; Linux 6.6:
452 AUE_FCHMODAT STD {
int linux_fchmodat2(
l_int dfd,
const char *filename,
l_mode_t mode,
l_int flags
);
452 AUE_NULL STD {
int linux_fchmodat2(void);
}
453 AUE_NULL STD {
int linux_map_shadow_stack(void);
+2 -5
View File
@@ -1246,10 +1246,7 @@ struct linux_cachestat_args {
syscallarg_t dummy;
};
struct linux_fchmodat2_args {
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)];
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
syscallarg_t dummy;
};
int linux_setxattr(struct thread *, struct linux_setxattr_args *);
int linux_lsetxattr(struct thread *, struct linux_lsetxattr_args *);
@@ -1770,7 +1767,7 @@ int linux_fchmodat2(struct thread *, struct linux_fchmodat2_args *);
#define LINUX_SYS_AUE_linux_futex_waitv AUE_NULL
#define LINUX_SYS_AUE_linux_set_mempolicy_home_node AUE_NULL
#define LINUX_SYS_AUE_linux_cachestat AUE_NULL
#define LINUX_SYS_AUE_linux_fchmodat2 AUE_FCHMODAT
#define LINUX_SYS_AUE_linux_fchmodat2 AUE_NULL
#undef PAD_
#undef PADL_
+1 -1
View File
@@ -466,5 +466,5 @@ struct sysent linux_sysent[] = {
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_futex_waitv, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 449 = linux_futex_waitv */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_set_mempolicy_home_node, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 450 = linux_set_mempolicy_home_node */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_cachestat, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 451 = linux_cachestat */
{ .sy_narg = AS(linux_fchmodat2_args), .sy_call = (sy_call_t *)linux_fchmodat2, .sy_auevent = AUE_FCHMODAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 452 = linux_fchmodat2 */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_fchmodat2, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 452 = linux_fchmodat2 */
};
+1 -25
View File
@@ -2428,12 +2428,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_fchmodat2 */
case 452: {
struct linux_fchmodat2_args *p = params;
iarg[a++] = p->dfd; /* l_int */
uarg[a++] = (intptr_t)p->filename; /* const char * */
iarg[a++] = p->mode; /* l_mode_t */
iarg[a++] = p->flags; /* l_int */
*n_args = 4;
*n_args = 0;
break;
}
default:
@@ -6373,22 +6368,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_fchmodat2 */
case 452:
switch (ndx) {
case 0:
p = "l_int";
break;
case 1:
p = "userland const char *";
break;
case 2:
p = "l_mode_t";
break;
case 3:
p = "l_int";
break;
default:
break;
};
break;
default:
break;
@@ -7700,9 +7679,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 451:
/* linux_fchmodat2 */
case 452:
if (ndx == 0 || ndx == 1)
p = "int";
break;
default:
break;
};
+2 -7
View File
@@ -1866,13 +1866,8 @@
int linux_cachestat(void);
}
; Linux 6.6:
452 AUE_FCHMODAT STD {
int linux_fchmodat2(
l_int dfd,
const char *filename,
l_mode_t mode,
l_int flags
);
452 AUE_NULL STD {
int linux_fchmodat2(void);
}
; vim: syntax=off
+2
View File
@@ -147,3 +147,5 @@ DUMMY(futex_waitv);
DUMMY(set_mempolicy_home_node);
/* Linux 6.5: */
DUMMY(cachestat);
/* Linux 6.6: */
DUMMY(fchmodat2);
-22
View File
@@ -779,28 +779,6 @@ linux_fchmodat(struct thread *td, struct linux_fchmodat_args *args)
args->mode, 0));
}
int
linux_fchmodat2(struct thread *td, struct linux_fchmodat2_args *args)
{
int bsdflags, dfd, lflags;
bsdflags = 0;
lflags = args->flags;
if ((lflags & ~(LINUX_AT_EMPTY_PATH | LINUX_AT_SYMLINK_NOFOLLOW)) != 0)
return (EINVAL);
if ((lflags & LINUX_AT_EMPTY_PATH) != 0)
bsdflags |= AT_EMPTY_PATH;
if ((lflags & LINUX_AT_SYMLINK_NOFOLLOW) != 0)
bsdflags |= AT_SYMLINK_NOFOLLOW;
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
return (kern_fchmodat(td, dfd, args->filename, UIO_USERSPACE,
args->mode, bsdflags));
}
#ifdef LINUX_LEGACY_SYSCALLS
int
linux_mkdir(struct thread *td, struct linux_mkdir_args *args)
+2 -5
View File
@@ -1731,10 +1731,7 @@ struct linux_cachestat_args {
syscallarg_t dummy;
};
struct linux_fchmodat2_args {
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
char mode_l_[PADL_(l_mode_t)]; l_mode_t mode; char mode_r_[PADR_(l_mode_t)];
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
syscallarg_t dummy;
};
int linux_exit(struct thread *, struct linux_exit_args *);
int linux_fork(struct thread *, struct linux_fork_args *);
@@ -2487,7 +2484,7 @@ int linux_fchmodat2(struct thread *, struct linux_fchmodat2_args *);
#define LINUX_SYS_AUE_linux_futex_waitv AUE_NULL
#define LINUX_SYS_AUE_linux_set_mempolicy_home_node AUE_NULL
#define LINUX_SYS_AUE_linux_cachestat AUE_NULL
#define LINUX_SYS_AUE_linux_fchmodat2 AUE_FCHMODAT
#define LINUX_SYS_AUE_linux_fchmodat2 AUE_NULL
#undef PAD_
#undef PADL_
+1 -1
View File
@@ -466,5 +466,5 @@ struct sysent linux_sysent[] = {
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_futex_waitv, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 449 = linux_futex_waitv */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_set_mempolicy_home_node, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 450 = linux_set_mempolicy_home_node */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_cachestat, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 451 = linux_cachestat */
{ .sy_narg = AS(linux_fchmodat2_args), .sy_call = (sy_call_t *)linux_fchmodat2, .sy_auevent = AUE_FCHMODAT, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 452 = linux_fchmodat2 */
{ .sy_narg = 0, .sy_call = (sy_call_t *)linux_fchmodat2, .sy_auevent = AUE_NULL, .sy_flags = 0, .sy_thrcnt = SY_THR_STATIC }, /* 452 = linux_fchmodat2 */
};
+1 -25
View File
@@ -3353,12 +3353,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
}
/* linux_fchmodat2 */
case 452: {
struct linux_fchmodat2_args *p = params;
iarg[a++] = p->dfd; /* l_int */
uarg[a++] = (intptr_t)p->filename; /* const char * */
iarg[a++] = p->mode; /* l_mode_t */
iarg[a++] = p->flags; /* l_int */
*n_args = 4;
*n_args = 0;
break;
}
default:
@@ -8742,22 +8737,6 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
/* linux_fchmodat2 */
case 452:
switch (ndx) {
case 0:
p = "l_int";
break;
case 1:
p = "userland const char *";
break;
case 2:
p = "l_mode_t";
break;
case 3:
p = "l_int";
break;
default:
break;
};
break;
default:
break;
@@ -10598,9 +10577,6 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
case 451:
/* linux_fchmodat2 */
case 452:
if (ndx == 0 || ndx == 1)
p = "int";
break;
default:
break;
};
+2 -7
View File
@@ -2630,13 +2630,8 @@
int linux_cachestat(void);
}
; Linux 6.6:
452 AUE_FCHMODAT STD {
int linux_fchmodat2(
l_int dfd,
const char *filename,
l_mode_t mode,
l_int flags
);
452 AUE_NULL STD {
int linux_fchmodat2(void);
}
; vim: syntax=off