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: <50C2820B.5060005@redhat.com>
Date:	Sat, 08 Dec 2012 00:55:55 +0100
From:	Milan Broz <mbroz@...hat.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Read O_DIRECT regression in 3.7-rc8 (bisected)

Hi Linus,

seems this commit in 3.7-rc8 caused regression for O_DIRECT
read near the end of the device.

bbec0270bdd887f96377065ee38b8848b5afa395 is the first bad commit
commit bbec0270bdd887f96377065ee38b8848b5afa395
Author: Linus Torvalds <torvalds@...ux-foundation.org>
Date:   Thu Nov 29 12:31:52 2012 -0800

    blkdev_max_block: make private to fs/buffer.c


With reproducer below (tested on i386), read should return
half of the buffer (8192 bytes), with patch above it fails
completely.

Milan

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

#define BLOCK 8192
int main (int argc, char *argv[])
{
        char *buf;
        int fd, r;

        if (posix_memalign((void*)&buf, 4096, 2 * BLOCK)) {
                printf("alloc fail\n");
                return 1;
        }

        fd = open("/dev/sdb", O_RDONLY|O_DIRECT);
        if (fd == -1) {
                printf("open fail\n");
                return 1;
        }

        if (lseek(fd, -BLOCK, SEEK_END) < 0) {
                printf("seek fail\n");
                close(fd);
                return 2;
        }

        r = read(fd, buf, 2 * BLOCK);
        printf("Read returned %d.\n", r);

        close(fd);
        return 0;
}
--
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