lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <a99a7fbe-ec31-4e31-87c7-1b7ae1dd1a5a@kernel.dk>
Date:   Fri, 27 Oct 2023 09:14:53 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>
Cc:     LKML <linux-kernel@...r.kernel.org>
Subject: lockdep: holding locks across syscall boundaries

Hi,

Normally we'd expect locking state to be clean and consistent across
syscall entry and exit, as that is always the case for sync syscalls.
We currently have a work-around for holding a lock from aio, see
kiocb_start_write(), which pretends to drop the lock from lockdeps
perspective, as it's held from submission to until kiocb_end_write() is
called at completion time.

This is a bit of an ugly work-around, and defeats the purpose of
lockdep.

Since I've now got another case where I want to hold a resource across
syscalls, is there a better way to do this?

This is for inode_dio_start(), which increments an inode int count, and
inode_dio_end() which decrements it. If a task is doing
inode_dio_start() and then inode_dio_wait(), I want to trigger this. I
have a hack that does this, but it disables lockdep_sys_exit() as
otherwise I just get that warning rather than the more useful one.

Thanks,
-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ