13 Sep, 2013

1 commit


18 Jun, 2013

1 commit


25 May, 2013

2 commits

  • Commit 902c098a3663 ("random: use lockless techniques in the interrupt
    path") turned IRQ path from being spinlock protected into lockless
    cmpxchg-retry update.

    That commit removed r->lock serialization between crediting entropy bits
    from IRQ context and accounting when extracting entropy on userspace
    read path, but didn't turn the r->entropy_count reads/updates in
    account() to use cmpxchg as well.

    It has been observed, that under certain circumstances this leads to
    read() on /dev/urandom to return 0 (EOF), as r->entropy_count gets
    corrupted and becomes negative, which in turn results in propagating 0
    all the way from account() to the actual read() call.

    Convert the accounting code to be the proper lockless counterpart of
    what has been partially done by 902c098a3663.

    Signed-off-by: Jiri Kosina
    Cc: Theodore Ts'o
    Cc: Greg KH
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Kosina
     
  • Commit ec8f02da9ea5 ("random: prime last_data value per fips
    requirements") added priming of last_data per fips requirements.

    Unfortuantely, it did so in a way that can lead to multiple threads all
    incrementing nbytes, but only one actually doing anything with the extra
    data, which leads to some fun random corruption and panics.

    The fix is to simply do everything needed to prime last_data in a single
    shot, so there's no window for multiple cpus to increment nbytes -- in
    fact, we won't even increment or decrement nbytes anymore, we'll just
    extract the needed EXTRACT_SIZE one time per pool and then carry on with
    the normal routine.

    All these changes have been tested across multiple hosts and
    architectures where panics were previously encoutered. The code changes
    are are strictly limited to areas only touched when when booted in fips
    mode.

    This change should also go into 3.8-stable, to make the myriads of fips
    users on 3.8.x happy.

    Signed-off-by: Jarod Wilson
    Tested-by: Jan Stancek
    Tested-by: Jan Stodola
    Cc: Herbert Xu
    Acked-by: Neil Horman
    Cc: "David S. Miller"
    Cc: Matt Mackall
    Cc: "Theodore Ts'o"
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jarod Wilson
     

01 May, 2013

1 commit

  • There are several places in kernel where modules unescapes input to convert
    C-Style Escape Sequences into byte codes.

    The patch provides generic implementation of such approach. Test cases are
    also included into the patch.

    [akpm@linux-foundation.org: clarify comment]
    [akpm@linux-foundation.org: export get_random_int() to modules]
    Signed-off-by: Andy Shevchenko
    Cc: Samuel Thibault
    Cc: Greg Kroah-Hartman
    Cc: Jason Baron
    Cc: Alexander Viro
    Cc: William Hubbs
    Cc: Chris Brannon
    Cc: Kirk Reiser
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Shevchenko
     

09 Mar, 2013

1 commit


05 Mar, 2013

1 commit

  • Commit 6133705494bb introduced a circular lock dependency because
    posix_cpu_timers_exit() is called by release_task(), which is holding
    a writer lock on tasklist_lock, and this can cause a deadlock since
    kill_fasync() gets called with nonblocking_pool.lock taken.

    There's no reason why kill_fasync() needs to be taken while the random
    pool is locked, so move it out to fix this locking dependency.

    Signed-off-by: "Theodore Ts'o"
    Reported-by: Russ Dill
    Cc: stable@kernel.org

    Theodore Ts'o
     

19 Feb, 2013

1 commit


08 Nov, 2012

2 commits

  • The value stored in last_data must be primed for FIPS 140-2 purposes. Upon
    first use, either on system startup or after an RNDCLEARPOOL ioctl, we
    need to take an initial random sample, store it internally in last_data,
    then pass along the value after that to the requester, so that consistency
    checks aren't being run against stale and possibly known data.

    CC: Herbert Xu
    CC: "David S. Miller"
    CC: Matt Mackall
    CC: linux-crypto@vger.kernel.org
    Acked-by: Neil Horman
    Signed-off-by: Jarod Wilson
    Signed-off-by: "Theodore Ts'o"

    Jarod Wilson
     
  • Fix the following warnings in formatting debug output:

    drivers/char/random.c: In function ‘xfer_secondary_pool’:
    drivers/char/random.c:827: warning: format ‘%d’ expects type ‘int’, but argument 7 has type ‘size_t’
    drivers/char/random.c: In function ‘account’:
    drivers/char/random.c:859: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’
    drivers/char/random.c:881: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘size_t’
    drivers/char/random.c: In function ‘random_read’:
    drivers/char/random.c:1141: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘ssize_t’
    drivers/char/random.c:1145: warning: format ‘%d’ expects type ‘int’, but argument 5 has type ‘ssize_t’
    drivers/char/random.c:1145: warning: format ‘%d’ expects type ‘int’, but argument 6 has type ‘long unsigned int’

    by using '%zd' instead of '%d' to properly denote ssize_t/size_t conversion.

    Signed-off-by: Jiri Kosina
    Signed-off-by: Theodore Ts'o

    Jiri Kosina
     

16 Oct, 2012

1 commit

  • The module parameter that turns debugging mode (which basically means
    printing a few extra lines during runtime) is in '#if 0' block. Forcing
    everyone who would like to see how entropy is behaving on his system to
    rebuild seems to be a little bit too harsh.

    If we were concerned about speed, we could potentially turn 'debug' into a
    static key, but I don't think it's necessary.

    Drop the '#if 0' block to allow using the 'debug' parameter without rebuilding.

    Signed-off-by: Jiri Kosina
    Signed-off-by: Theodore Ts'o

    Jiri Kosina
     

28 Jul, 2012

1 commit

  • Mix in any architectural randomness in extract_buf() instead of
    xfer_secondary_buf(). This allows us to mix in more architectural
    randomness, and it also makes xfer_secondary_buf() faster, moving a
    tiny bit of additional CPU overhead to process which is extracting the
    randomness.

    [ Commit description modified by tytso to remove an extended
    advertisement for the RDRAND instruction. ]

    Signed-off-by: H. Peter Anvin
    Acked-by: Ingo Molnar
    Cc: DJ Johnston
    Signed-off-by: Theodore Ts'o
    Cc: stable@vger.kernel.org

    H. Peter Anvin
     

25 Jul, 2012

1 commit

  • Many platforms have per-machine instance data (serial numbers,
    asset tags, etc.) squirreled away in areas that are accessed
    during early system bringup. Mixing this data into the random
    pools has a very high value in providing better random data,
    so we should allow (and even encourage) architecture code to
    call add_device_randomness() from the setup_arch() paths.

    However, this limits our options for internal structure of
    the random driver since random_initialize() is not called
    until long after setup_arch().

    Add a big fat comment to rand_initialize() spelling out
    this requirement.

    Suggested-by: Theodore Ts'o
    Signed-off-by: Tony Luck
    Signed-off-by: Theodore Ts'o

    Tony Luck
     

19 Jul, 2012

1 commit

  • With the new interrupt sampling system, we are no longer using the
    timer_rand_state structure in the irq descriptor, so we can stop
    initializing it now.

    [ Merged in fixes from Sedat to find some last missing references to
    rand_initialize_irq() ]

    Signed-off-by: "Theodore Ts'o"
    Signed-off-by: Sedat Dilek

    Theodore Ts'o
     

15 Jul, 2012

6 commits

  • Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • Create a new function, get_random_bytes_arch() which will use the
    architecture-specific hardware random number generator if it is
    present. Change get_random_bytes() to not use the HW RNG, even if it
    is avaiable.

    The reason for this is that the hw random number generator is fast (if
    it is present), but it requires that we trust the hardware
    manufacturer to have not put in a back door. (For example, an
    increasing counter encrypted by an AES key known to the NSA.)

    It's unlikely that Intel (for example) was paid off by the US
    Government to do this, but it's impossible for them to prove otherwise
    --- especially since Bull Mountain is documented to use AES as a
    whitener. Hence, the output of an evil, trojan-horse version of
    RDRAND is statistically indistinguishable from an RDRAND implemented
    to the specifications claimed by Intel. Short of using a tunnelling
    electronic microscope to reverse engineer an Ivy Bridge chip and
    disassembling and analyzing the CPU microcode, there's no way for us
    to tell for sure.

    Since users of get_random_bytes() in the Linux kernel need to be able
    to support hardware systems where the HW RNG is not present, most
    time-sensitive users of this interface have already created their own
    cryptographic RNG interface which uses get_random_bytes() as a seed.
    So it's much better to use the HW RNG to improve the existing random
    number generator, by mixing in any entropy returned by the HW RNG into
    /dev/random's entropy pool, but to always _use_ /dev/random's entropy
    pool.

    This way we get almost of the benefits of the HW RNG without any
    potential liabilities. The only benefits we forgo is the
    speed/performance enhancements --- and generic kernel code can't
    depend on depend on get_random_bytes() having the speed of a HW RNG
    anyway.

    For those places that really want access to the arch-specific HW RNG,
    if it is available, we provide get_random_bytes_arch().

    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Theodore Ts'o
     
  • If the CPU supports a hardware random number generator, use it in
    xfer_secondary_pool(), where it will significantly improve things and
    where we can afford it.

    Also, remove the use of the arch-specific rng in
    add_timer_randomness(), since the call is significantly slower than
    get_cycles(), and we're much better off using it in
    xfer_secondary_pool() anyway.

    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Theodore Ts'o
     
  • Add a new interface, add_device_randomness() for adding data to the
    random pool that is likely to differ between two devices (or possibly
    even per boot). This would be things like MAC addresses or serial
    numbers, or the read-out of the RTC. This does *not* add any actual
    entropy to the pool, but it initializes the pool to different values
    for devices that might otherwise be identical and have very little
    entropy available to them (particularly common in the embedded world).

    [ Modified by tytso to mix in a timestamp, since there may be some
    variability caused by the time needed to detect/configure the hardware
    in question. ]

    Signed-off-by: Linus Torvalds
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Linus Torvalds
     
  • The real-time Linux folks don't like add_interrupt_randomness() taking
    a spinlock since it is called in the low-level interrupt routine.
    This also allows us to reduce the overhead in the fast path, for the
    random driver, which is the interrupt collection path.

    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Theodore Ts'o
     
  • We've been moving away from add_interrupt_randomness() for various
    reasons: it's too expensive to do on every interrupt, and flooding the
    CPU with interrupts could theoretically cause bogus floods of entropy
    from a somewhat externally controllable source.

    This solves both problems by limiting the actual randomness addition
    to just once a second or after 64 interrupts, whicever comes first.
    During that time, the interrupt cycle data is buffered up in a per-cpu
    pool. Also, we make sure the the nonblocking pool used by urandom is
    initialized before we start feeding the normal input pool. This
    assures that /dev/urandom is returning unpredictable data as soon as
    possible.

    (Based on an original patch by Linus, but significantly modified by
    tytso.)

    Tested-by: Eric Wustrow
    Reported-by: Eric Wustrow
    Reported-by: Nadia Heninger
    Reported-by: Zakir Durumeric
    Reported-by: J. Alex Halderman .
    Signed-off-by: Linus Torvalds
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Theodore Ts'o
     

07 Jul, 2012

1 commit


13 Apr, 2012

1 commit

  • /proc/sys/kernel/random/boot_id can be read concurrently by userspace
    processes. If two (or more) user-space processes concurrently read
    boot_id when sysctl_bootid is not yet assigned, a race can occur making
    boot_id differ between the reads. Because the whole point of the boot id
    is to be unique across a kernel execution, fix this by protecting this
    operation with a spinlock.

    Given that this operation is not frequently used, hitting the spinlock
    on each call should not be an issue.

    Signed-off-by: Mathieu Desnoyers
    Cc: "Theodore Ts'o"
    Cc: Matt Mackall
    Signed-off-by: Eric Dumazet
    Cc: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mathieu Desnoyers
     

17 Jan, 2012

3 commits


13 Jan, 2012

1 commit


30 Dec, 2011

1 commit

  • We still don't use rdrand in /dev/random, which just seems stupid. We
    accept the *cycle*counter* as a random input, but we don't accept
    rdrand? That's just broken.

    Sure, people can do things in user space (write to /dev/random, use
    rdrand in addition to /dev/random themselves etc etc), but that
    *still* seems to be a particularly stupid reason for saying "we
    shouldn't bother to try to do better in /dev/random".

    And even if somebody really doesn't trust rdrand as a source of random
    bytes, it seems singularly stupid to trust the cycle counter *more*.

    So I'd suggest the attached patch. I'm not going to even bother
    arguing that we should add more bits to the entropy estimate, because
    that's not the point - I don't care if /dev/random fills up slowly or
    not, I think it's just stupid to not use the bits we can get from
    rdrand and mix them into the strong randomness pool.

    Link: http://lkml.kernel.org/r/CA%2B55aFwn59N1=m651QAyTy-1gO1noGbK18zwKDwvwqnravA84A@mail.gmail.com
    Acked-by: "David S. Miller"
    Acked-by: "Theodore Ts'o"
    Acked-by: Herbert Xu
    Cc: Matt Mackall
    Cc: Tony Luck
    Cc: Eric Dumazet
    Signed-off-by: H. Peter Anvin

    Linus Torvalds
     

17 Nov, 2011

1 commit

  • If there is an architecture-specific random number generator we use it
    to acquire randomness one "long" at a time. We should put these random
    words into consecutive words in the result buffer - not just overwrite
    the first word again and again.

    Signed-off-by: Tony Luck
    Acked-by: H. Peter Anvin
    Acked-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Luck, Tony
     

28 Oct, 2011

1 commit

  • * 'x86-rdrand-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86, random: Verify RDRAND functionality and allow it to be disabled
    x86, random: Architectural inlines to get random integers with RDRAND
    random: Add support for architectural random hooks

    Fix up trivial conflicts in drivers/char/random.c: the architectural
    random hooks touched "get_random_int()" that was simplified to use MD5
    and not do the keyptr thing any more (see commit 6e5714eaf77d: "net:
    Compute protocol sequence numbers and fragment IDs using MD5").

    Linus Torvalds
     

07 Aug, 2011

1 commit

  • Computers have become a lot faster since we compromised on the
    partial MD4 hash which we use currently for performance reasons.

    MD5 is a much safer choice, and is inline with both RFC1948 and
    other ISS generators (OpenBSD, Solaris, etc.)

    Furthermore, only having 24-bits of the sequence number be truly
    unpredictable is a very serious limitation. So the periodic
    regeneration and 8-bit counter have been removed. We compute and
    use a full 32-bit sequence number.

    For ipv6, DCCP was found to use a 32-bit truncated initial sequence
    number (it needs 43-bits) and that is fixed here as well.

    Reported-by: Dan Kaminsky
    Tested-by: Willy Tarreau
    Signed-off-by: David S. Miller

    David S. Miller
     

01 Aug, 2011

1 commit

  • Add support for architecture-specific hooks into the kernel-directed
    random number generator interfaces. This patchset does not use the
    architecture random number generator interfaces for the
    userspace-directed interfaces (/dev/random and /dev/urandom), thus
    eliminating the need to distinguish between them based on a pool
    pointer.

    Changes in version 3:
    - Moved the hooks from extract_entropy() to get_random_bytes().
    - Changes the hooks to inlines.

    Signed-off-by: H. Peter Anvin
    Cc: Fenghua Yu
    Cc: Matt Mackall
    Cc: Herbert Xu
    Cc: "Theodore Ts'o"

    H. Peter Anvin
     

22 Jul, 2011

1 commit

  • IPv6 fragment identification generation is way beyond what we use for
    IPv4 : It uses a single generator. Its not scalable and allows DOS
    attacks.

    Now inetpeer is IPv6 aware, we can use it to provide a more secure and
    scalable frag ident generator (per destination, instead of system wide)

    This patch :
    1) defines a new secure_ipv6_id() helper
    2) extends inet_getid() to provide 32bit results
    3) extends ipv6_select_ident() with a new dest parameter

    Reported-by: Fernando Gont
    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

31 Mar, 2011

1 commit


21 Feb, 2011

1 commit

  • At present, the comment header in random.c makes no mention of
    add_disk_randomness, and instead, suggests that disk activity adds to the
    random pool by way of add_interrupt_randomness, which appears to not have
    been the case since sometime prior to the existence of git, and even prior
    to bitkeeper. Didn't look any further back. At least, as far as I can
    tell, there are no storage drivers setting IRQF_SAMPLE_RANDOM, which is a
    requirement for add_interrupt_randomness to trigger, so the only way for a
    disk to contribute entropy is by way of add_disk_randomness. Update
    comments accordingly, complete with special mention about solid state
    drives being a crappy source of entropy (see e2e1a148bc for reference).

    Signed-off-by: Jarod Wilson
    Acked-by: Matt Mackall
    Signed-off-by: Herbert Xu

    Jarod Wilson
     

17 Dec, 2010

1 commit


15 Oct, 2010

1 commit

  • All file_operations should get a .llseek operation so we can make
    nonseekable_open the default for future file operations without a
    .llseek pointer.

    The three cases that we can automatically detect are no_llseek, seq_lseek
    and default_llseek. For cases where we can we can automatically prove that
    the file offset is always ignored, we use noop_llseek, which maintains
    the current behavior of not returning an error from a seek.

    New drivers should normally not use noop_llseek but instead use no_llseek
    and call nonseekable_open at open time. Existing drivers can be converted
    to do the same when the maintainer knows for certain that no user code
    relies on calling seek on the device file.

    The generated code is often incorrectly indented and right now contains
    comments that clarify for each added line why a specific variant was
    chosen. In the version that gets submitted upstream, the comments will
    be gone and I will manually fix the indentation, because there does not
    seem to be a way to do that using coccinelle.

    Some amount of new code is currently sitting in linux-next that should get
    the same modifications, which I will do at the end of the merge window.

    Many thanks to Julia Lawall for helping me learn to write a semantic
    patch that does all this.

    ===== begin semantic patch =====
    // This adds an llseek= method to all file operations,
    // as a preparation for making no_llseek the default.
    //
    // The rules are
    // - use no_llseek explicitly if we do nonseekable_open
    // - use seq_lseek for sequential files
    // - use default_llseek if we know we access f_pos
    // - use noop_llseek if we know we don't access f_pos,
    // but we still want to allow users to call lseek
    //
    @ open1 exists @
    identifier nested_open;
    @@
    nested_open(...)
    {

    }

    @ open exists@
    identifier open_f;
    identifier i, f;
    identifier open1.nested_open;
    @@
    int open_f(struct inode *i, struct file *f)
    {

    }

    @ read disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {

    }

    @ read_no_fpos disable optional_qualifier exists @
    identifier read_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t read_f(struct file *f, char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ write @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    expression E;
    identifier func;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {

    }

    @ write_no_fpos @
    identifier write_f;
    identifier f, p, s, off;
    type ssize_t, size_t, loff_t;
    @@
    ssize_t write_f(struct file *f, const char *p, size_t s, loff_t *off)
    {
    ... when != off
    }

    @ fops0 @
    identifier fops;
    @@
    struct file_operations fops = {
    ...
    };

    @ has_llseek depends on fops0 @
    identifier fops0.fops;
    identifier llseek_f;
    @@
    struct file_operations fops = {
    ...
    .llseek = llseek_f,
    ...
    };

    @ has_read depends on fops0 @
    identifier fops0.fops;
    identifier read_f;
    @@
    struct file_operations fops = {
    ...
    .read = read_f,
    ...
    };

    @ has_write depends on fops0 @
    identifier fops0.fops;
    identifier write_f;
    @@
    struct file_operations fops = {
    ...
    .write = write_f,
    ...
    };

    @ has_open depends on fops0 @
    identifier fops0.fops;
    identifier open_f;
    @@
    struct file_operations fops = {
    ...
    .open = open_f,
    ...
    };

    // use no_llseek if we call nonseekable_open
    ////////////////////////////////////////////
    @ nonseekable1 depends on !has_llseek && has_open @
    identifier fops0.fops;
    identifier nso ~= "nonseekable_open";
    @@
    struct file_operations fops = {
    ... .open = nso, ...
    +.llseek = no_llseek, /* nonseekable */
    };

    @ nonseekable2 depends on !has_llseek @
    identifier fops0.fops;
    identifier open.open_f;
    @@
    struct file_operations fops = {
    ... .open = open_f, ...
    +.llseek = no_llseek, /* open uses nonseekable */
    };

    // use seq_lseek for sequential files
    /////////////////////////////////////
    @ seq depends on !has_llseek @
    identifier fops0.fops;
    identifier sr ~= "seq_read";
    @@
    struct file_operations fops = {
    ... .read = sr, ...
    +.llseek = seq_lseek, /* we have seq_read */
    };

    // use default_llseek if there is a readdir
    ///////////////////////////////////////////
    @ fops1 depends on !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier readdir_e;
    @@
    // any other fop is used that changes pos
    struct file_operations fops = {
    ... .readdir = readdir_e, ...
    +.llseek = default_llseek, /* readdir is present */
    };

    // use default_llseek if at least one of read/write touches f_pos
    /////////////////////////////////////////////////////////////////
    @ fops2 depends on !fops1 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read.read_f;
    @@
    // read fops use offset
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = default_llseek, /* read accesses f_pos */
    };

    @ fops3 depends on !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ... .write = write_f, ...
    + .llseek = default_llseek, /* write accesses f_pos */
    };

    // Use noop_llseek if neither read nor write accesses f_pos
    ///////////////////////////////////////////////////////////

    @ fops4 depends on !fops1 && !fops2 && !fops3 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    identifier write_no_fpos.write_f;
    @@
    // write fops use offset
    struct file_operations fops = {
    ...
    .write = write_f,
    .read = read_f,
    ...
    +.llseek = noop_llseek, /* read and write both use no f_pos */
    };

    @ depends on has_write && !has_read && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier write_no_fpos.write_f;
    @@
    struct file_operations fops = {
    ... .write = write_f, ...
    +.llseek = noop_llseek, /* write uses no f_pos */
    };

    @ depends on has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    identifier read_no_fpos.read_f;
    @@
    struct file_operations fops = {
    ... .read = read_f, ...
    +.llseek = noop_llseek, /* read uses no f_pos */
    };

    @ depends on !has_read && !has_write && !fops1 && !fops2 && !has_llseek && !nonseekable1 && !nonseekable2 && !seq @
    identifier fops0.fops;
    @@
    struct file_operations fops = {
    ...
    +.llseek = noop_llseek, /* no read or write fn */
    };
    ===== End semantic patch =====

    Signed-off-by: Arnd Bergmann
    Cc: Julia Lawall
    Cc: Christoph Hellwig

    Arnd Bergmann
     

31 Jul, 2010

1 commit


20 May, 2010

1 commit


04 Feb, 2010

1 commit


02 Feb, 2010

1 commit