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-prev] [day] [month] [year] [list]
Date:	Thu, 5 Feb 2009 16:33:18 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [RESEND] [PATCH] lseek: remove i_mutex

On Fri, 06 Feb 2009 09:20:30 +0900
Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp> wrote:

> 
> At 05:05 09/02/06, Andrew Morton wrote:
> >On Tue, 03 Feb 2009 17:04:40 +0900
> >Hisashi Hifumi <hifumi.hisashi@....ntt.co.jp> wrote:
> >
> >> I removed i_mutex from generic_file_llseek.
> >> I think that the reason of protecting lseek with i_mutex is just
> >> touching i_size atomically.
> >> 
> >> So I introduce i_size_read here so i_mutex is no longer needed.
> >> 
> >> Following patch removes i_mutex from generic_file_llseek, and deletes 
> >> generic_file_llseek_nolock totally.
> >> 
> >> Currently there is i_mutex contention not only around lseek, but also 
> >fsync or write.
> >> So,  I think we can mitigate i_mutex contention between fsync lseek and 
> >write by
> >> removing i_mutex.
> >
> >Prior to this change, generic_file_llseek() modified file->f_pos
> >atomically with respect to other i_mutex holders.
> >
> >After this change, it doesn't.
> 
> Hi Andrew.
> 
> Even before this change is applied, file->f_pos access is not atomic.
> sys_read change f_pos value through file_pos_write without i_mutex.

I know.  That's why I specified "with respect to other i_mutex holders".

This patch makes things worse.

At very very minimum the changelog should explain that this patch makes
things worse, and demonstrate why this is justifiable.

> I think seqlock is needed to make f_pos access atomic.

Maybe.  Or atomic64_t, or spinlocking, or i_mutex, or something else.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ