Re: [PATCH v2 003/110] audit: widen ino fields to u64
Paul Moore <[email protected]> Tue, 3 Mar 2026 11:03:20 -0500
| Newsgroups | gmane.linux.network,gmane.linux.file-systems,gmane.linux.kernel,gmane.linux.kernel.mm,gmane.comp.file-systems.ext4,gmane.linux.file-systems.f2fs,gmane.linux.nfs,gmane.linux.kernel.cifs,gmane.network.samba.internals,gmane.comp.file-systems.nilfs.user,gmane.linux.kernel.autofs,gmane.comp.file-systems.ceph.devel,gmane.comp.file-systems.coda.general,gmane.comp.file-systems.ecryptfs.general,gmane.linux.drivers.mtd,gmane.linux.file-systems.union,gmane.comp.security.apparmor,gmane.linux.kernel.lsm,gmane.comp.freedesktop.amd-gfx,gmane.comp.video.dri.devel,gmane.linux.drivers.video-input-infrastructure,gmane.linux.kernel.perf.user,gmane.linux.hams,gmane.linux.x25,gmane.linux.bluez.kernel,gmane.linux.can,gmane.linux.kernel.bpf |
|---|---|
| Message-ID | <CAHC9VhTyhnG7-ojnTnVdh_m1x=rKxw9YEH9g7Xp9m4F78aA5cA@mail.gmail.com> |
On Tue, Mar 3, 2026 at 6:05=E2=80=AFAM Jeff Layton <[email protected]> wro= te: > On Mon, 2026-03-02 at 18:44 -0500, Paul Moore wrote: > > On Mon, Mar 2, 2026 at 3:25=E2=80=AFPM Jeff Layton <[email protected]>= wrote: > > > > > > inode->i_ino is being widened from unsigned long to u64. The audit > > > subsystem uses unsigned long ino in struct fields, function parameter= s, > > > and local variables that store inode numbers from arbitrary filesyste= ms. > > > On 32-bit platforms this truncates inode numbers that exceed 32 bits, > > > which will cause incorrect audit log entries and broken watch/mark > > > comparisons. > > > > > > Widen all audit ino fields, parameters, and locals to u64, and update > > > the inode format string from %lu to %llu to match. > > > > > > Signed-off-by: Jeff Layton <[email protected]> > > > --- > > > include/linux/audit.h | 2 +- > > > kernel/audit.h | 9 ++++----- > > > kernel/audit_fsnotify.c | 4 ++-- > > > kernel/audit_watch.c | 8 ++++---- > > > kernel/auditsc.c | 2 +- > > > 5 files changed, 12 insertions(+), 13 deletions(-) > > > > We should also update audit_hash_ino() in kernel/audit.h. It is a > > *very* basic hash function, so I think leaving the function as-is and > > just changing the inode parameter from u32 to u64 should be fine. ... > It doesn't look like changing the argument type will make any material > difference. Given that it should still work without that change, can we > leave this cleanup for you to do in a follow-on patchset? I would prefer if you made the change as part of the patch, mainly to keep a patch record of this being related. Ideally I'd really like to see kino_t used in the audit code instead of u64, but perhaps that is done in a later patch that I didn't see. --=20 paul-moore.com