Skip to content

Commit 6cfed8d

Browse files
committed
Fix kernel_abi size checks on 32-bit rr
1 parent c9349cc commit 6cfed8d

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/kernel_abi.h

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,8 @@ struct BaseArch : public wordsize,
11061106
off_t l_len;
11071107
pid_t l_pid;
11081108
};
1109-
RR_VERIFY_TYPE_EXPLICIT(struct ::flock, _flock);
1109+
// Doesn't verify on x86-32 where our system off_t is 64 bits because
1110+
// we need to access large files.
11101111

11111112
struct flock64 {
11121113
signed_short l_type;
@@ -1325,7 +1326,8 @@ struct BaseArch : public wordsize,
13251326
rlim_t rlim_cur;
13261327
rlim_t rlim_max;
13271328
};
1328-
RR_VERIFY_TYPE(rlimit);
1329+
// Doesn't verify on x86-32 where our system off_t is 64 bits because
1330+
// we need to access large files.
13291331

13301332
struct rlimit64 {
13311333
rlim64_t rlim_cur;
@@ -1355,7 +1357,8 @@ struct BaseArch : public wordsize,
13551357
__statfs_word f_flags;
13561358
__statfs_word f_spare[4];
13571359
};
1358-
RR_VERIFY_TYPE_EXPLICIT(struct ::statfs, statfs_t);
1360+
// Doesn't verify on x86-32 where our system __fsblkcnt_t is 64 bits because
1361+
// we need to access large files.
13591362

13601363
/* Don't align for the 64-bit values on 32-bit x86 */
13611364
struct __attribute__((packed)) statfs64_t {
@@ -1568,7 +1571,8 @@ struct BaseArch : public wordsize,
15681571
// uint8_t d_type;
15691572
uint8_t d_name[256];
15701573
};
1571-
RR_VERIFY_TYPE(dirent);
1574+
// Doesn't verify on x86-32 where our system dirent uses 64-bit ino/off because
1575+
// we need to access large files.
15721576

15731577
struct dirent64 {
15741578
ino64_t d_ino;
@@ -2271,6 +2275,11 @@ struct X64Arch : public BaseArch<SupportedArch::x86_64, WordSize64Defs> {
22712275
uint32_t rule_locs[0];
22722276
};
22732277
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::ethtool_rxnfc, struct ethtool_rxnfc);
2278+
2279+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::flock, _flock);
2280+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::rlimit, rlimit);
2281+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::statfs, statfs_t);
2282+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::dirent, dirent);
22742283
};
22752284

22762285
struct X86Arch : public BaseArch<SupportedArch::x86, WordSize32Defs> {
@@ -2433,7 +2442,8 @@ struct X86Arch : public BaseArch<SupportedArch::x86, WordSize32Defs> {
24332442
unsigned_long __unused4;
24342443
unsigned_long __unused5;
24352444
};
2436-
RR_VERIFY_TYPE_ARCH(SupportedArch::x86, struct ::stat, struct stat_t);
2445+
// Doesn't verify on x86-32 where various fields are 64 bits because
2446+
// we need to access large files/filesystems.
24372447

24382448
struct __attribute__((packed)) stat64_t {
24392449
dev_t st_dev;
@@ -2644,6 +2654,11 @@ struct ARM64Arch : public GenericArch<SupportedArch::aarch64, WordSize64Defs> {
26442654
};
26452655
RR_VERIFY_TYPE_ARCH(SupportedArch::aarch64, struct ::ethtool_rxnfc, struct ethtool_rxnfc);
26462656

2657+
RR_VERIFY_TYPE_ARCH(SupportedArch::aarch64, struct ::flock, _flock);
2658+
RR_VERIFY_TYPE_ARCH(SupportedArch::aarch64, struct ::rlimit, rlimit);
2659+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::statfs, statfs_t);
2660+
RR_VERIFY_TYPE_ARCH(SupportedArch::x86_64, struct ::dirent, dirent);
2661+
26472662
struct user_pac_address_keys {
26482663
__uint128_t apiakey;
26492664
__uint128_t apibkey;

0 commit comments

Comments
 (0)