1. 07 11月, 2013 2 次提交
  2. 28 10月, 2013 33 次提交
  3. 26 10月, 2013 3 次提交
  4. 25 10月, 2013 2 次提交
    • G
      seq_file: always update file->f_pos in seq_lseek() · 05e16745
      Gu Zheng 提交于
      This issue was first pointed out by Jiaxing Wang several months ago, but no
      further comments:
      https://lkml.org/lkml/2013/6/29/41
      
      As we know pread() does not change f_pos, so after pread(), file->f_pos
      and m->read_pos become different. And seq_lseek() does not update file->f_pos
      if offset equals to m->read_pos, so after pread() and seq_lseek()(lseek to
      m->read_pos), then a subsequent read may read from a wrong position, the
      following program produces the problem:
      
          char str1[32] = { 0 };
          char str2[32] = { 0 };
          int poffset = 10;
          int count = 20;
      
          /*open any seq file*/
          int fd = open("/proc/modules", O_RDONLY);
      
          pread(fd, str1, count, poffset);
          printf("pread:%s\n", str1);
      
          /*seek to where m->read_pos is*/
          lseek(fd, poffset+count, SEEK_SET);
      
          /*supposed to read from poffset+count, but this read from position 0*/
          read(fd, str2, count);
          printf("read:%s\n", str2);
      
      out put:
      pread:
       ck_netbios_ns 12665
      read:
       nf_conntrack_netbios
      
      /proc/modules:
      nf_conntrack_netbios_ns 12665 0 - Live 0xffffffffa038b000
      nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns, Live 0xffffffffa0386000
      
      So we always update file->f_pos to offset in seq_lseek() to fix this issue.
      Signed-off-by: NJiaxing Wang <hello.wjx@gmail.com>
      Signed-off-by: NGu Zheng <guz.fnst@cn.fujitsu.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      05e16745
    • L
      Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc · 4208c471
      Linus Torvalds 提交于
      Pull ARM SoC fixes from Olof Johansson:
       "There's really only one bugfix in this branch, which is a fix for
        timers on the integrator platform.  Since Linus Walleij is
        resurrecting support for the platform it seems valuable to get the fix
        into 3.12 even though the regression has been around a while.
      
        The rest are a handful of maintainers updates.  If you prefer to hold
        those until 3.13 then just merge the first patch on the branch which
        is the fix"
      
      * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
        MAINTAINERS: Add maintainers entry for Rockchip SoCs
        MAINTAINERS: Tegra updates, and driver ownership
        MAINTAINERS: ARM: mvebu: add Sebastian Hesselbarth
        ARM: integrator: deactivate timer0 on the Integrator/CP
      4208c471
新手
引导
客服 返回
顶部