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  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]
Date:	Fri, 8 Aug 2014 00:11:39 +0100
From:	Anton Altaparmakov <>
To:	Al Viro <>
Cc:	linux-fsdevel <>,
	linux-kernel <>
Subject: Bug introduced in 3b93f911d5

Hi Al,

Was just looking at __generic_file_write_iter() and found a bug in the code that you added in 3b93f911d5.

Consider the case where generic_file_direct_write() returns a partial write, i.e. written > 0 && written < count.

Also consider that the following generic_perform_write() fails with an error, i.e. status < 0.

This code then does something very bogus:

		if (unlikely(status < 0) && !written) {
			err = status;
			goto out;
		iocb->ki_pos = pos + status;
		endbyte = pos + status - 1;

The if condition is false as written is > 0 yet status is negative thus iocb->ki_pos is set to pos + status where status is negative thus ki_pos is actually set to "pos - random value".

And similar for "endbyte" being set to "pos - random value - 1", etc.

Doesn't seem like that is what you intended?

Best regards,

Anton Altaparmakov <aia21 at> (replace at with @)
University of Cambridge Information Services, Roger Needham Building
7 JJ Thomson Avenue, Cambridge, CB3 0RB, UK

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists