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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 1 May 2007 20:58:02 -0700 (PDT)
From:	Christoph Lameter <clameter@....com>
To:	Nate Diller <nate.diller@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Satyam Sharma <satyam.sharma@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] zero_user_page uses in fs/buffer.c and fs/libfs.c

On Tue, 1 May 2007, Nate Diller wrote:

> well, leave it to me to reply too quickly, sorry.  i think we should
> leave simple_prepare_write() the way it is, since it's a library
> function itself.  the other two callsites in your patch are buffers,
> which may themselves be smaller than a page so you would need a
> special function for just those two uses, there's no other way to
> avoid making two calls to flush_dcache_page().  if it's tremendously
> important to you to eliminate open coding of these, maybe make a
> 'static int buffer_prepare_write()' or some such in fs/buffer.c

All three sites zap two parts of a page. If we had a 
zero_user_page2 like this

zero_user_page2(page, start1, end1, start2, end2, kmap)

then all 3 sites could use the same funtion.

libfs.c:

zero_user_page_segments(page, 0, from, to, PAGE_CACHE_SIZE, KM_USER0);

buffer.c:

zero_user_page_segments(page, from, block_start, to, block_end, KM_USER0)

zero_user_page_segments(page, blockstart, from, to, block_end, KM_USER0)


I did not look through the whole kernel but this zapping segments is 
likely frequent given the nature of the blocklayer.

The 3 call sites pretty ugly on their own. I think it would be good 
to have one clearly commented version of this somewhere. Call sites
will be much clearer since you do not have the kmap_ obfuscation nor
the calculation of the length of each segment.

-
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