aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-06-29[readdir] convert affsAl Viro1-45/+24
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert adfsAl Viro1-24/+18
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert logfsAl Viro1-34/+15
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert jfsAl Viro3-36/+31
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert cephAl Viro1-51/+48
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert nfsAl Viro1-26/+25
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert ext4Al Viro3-190/+134
and trim the living hell out bogosities in inline dir case Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert qnx6Al Viro1-17/+14
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert qnx4Al Viro1-35/+31
... and use strnlen() instead of strlen() - it's done on untrusted data, after all. Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert omfsAl Viro1-56/+38
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert nilfs2Al Viro1-30/+18
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert sysfsAl Viro1-48/+18
get rid of the kludges in sysfs_readdir() Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert gfs2Al Viro4-51/+38
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert exofsAl Viro1-22/+16
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert bfsAl Viro1-21/+14
... and get rid of that ridiculous mutex in bfs_readdir() Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert procfsAl Viro9-489/+284
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert openpromfsAl Viro1-51/+44
what the hell is op_mutex for, BTW? Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert efsAl Viro1-42/+33
* sanity checks belong before risky operation, not after it * don't quit as soon as we'd found an entry Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert configfsAl Viro1-70/+52
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert romfsAl Viro1-12/+9
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert squashfsAl Viro1-28/+12
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert ubifsAl Viro1-41/+16
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert udfAl Viro1-37/+26
Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] convert ext3Al Viro2-93/+70
new helper: dir_relax(inode). Call when you are in location that will _not_ be invalidated by directory modifications (block boundary, in case of ext*). Returns whether the directory has survived (dropping i_mutex allows rmdir to kill the sucker; if it returns false to us, ->iterate() is obviously done) Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] switch dcache_readdir() users to ->iterate()Al Viro4-60/+65
new helpers - dir_emit_dot(file, ctx, dentry), dir_emit_dotdot(file, ctx), dir_emit_dots(file, ctx). Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] simple local unixlike: switch to ->iterate()Al Viro4-75/+59
ext2, ufs, minix, sysv Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] introduce ->iterate(), ctx->pos, dir_emit()Al Viro7-18/+47
New method - ->iterate(file, ctx). That's the replacement for ->readdir(); it takes callback from ctx->actor, uses ctx->pos instead of file->f_pos and calls dir_emit(ctx, ...) instead of filldir(data, ...). It does *not* update file->f_pos (or look at it, for that matter); iterate_dir() does the update. Note that dir_emit() takes the offset from ctx->pos (and eventually filldir_t will lose that argument). Signed-off-by: Al Viro <[email protected]>
2013-06-29[readdir] introduce iterate_dir() and dir_contextAl Viro10-20/+53
iterate_dir(): new helper, replacing vfs_readdir(). struct dir_context: contains the readdir callback (and will get more stuff in it), embedded into whatever data that callback wants to deal with; eventually, we'll be passing it to ->readdir() replacement instead of (data,filldir) pair. Signed-off-by: Al Viro <[email protected]>
2013-06-29move linux/loop.h to drivers/blockAl Viro3-3/+3
Signed-off-by: Al Viro <[email protected]>
2013-06-29compat.c: LOOP_CLR_FD is taken care of in loop.c itself...Al Viro1-3/+0
Signed-off-by: Al Viro <[email protected]>
2013-06-29pxa3xx: VM_IO is set by io_remap_pfn_range()Al Viro1-1/+0
Signed-off-by: Al Viro <[email protected]>
2013-06-29au1100fb: VM_IO is set by io_remap_pfn_range()Al Viro1-2/+0
Signed-off-by: Al Viro <[email protected]>
2013-06-29au1200fb: io_remap_pfn_range() sets VM_IOAl Viro1-4/+0
... and single return is quite sufficient to get out of function, TYVM Signed-off-by: Al Viro <[email protected]>
2013-06-29vfio: remap_pfn_range() sets all those flags...Al Viro1-1/+0
Signed-off-by: Al Viro <[email protected]>
2013-06-29i810: VM_IO is set by io_remap_pfn_range()Al Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2013-06-29drm: io_remap_pfn_range() sets VM_IO...Al Viro1-1/+0
Signed-off-by: Al Viro <[email protected]>
2013-06-29sparc: __pci_mmap_set_flags() is uselessAl Viro1-10/+0
io_remap_pfn_range() does all we need Signed-off-by: Al Viro <[email protected]>
2013-06-29mn10300: don't bother with VM_IOAl Viro1-1/+1
io_remap_pfn_range() sets it Signed-off-by: Al Viro <[email protected]>
2013-06-29hose_mmap_page_range(): io_remap_pfn_range() will set all those flags...Al Viro1-1/+0
Signed-off-by: Al Viro <[email protected]>
2013-06-29samsung: don't bother with setting VM_IOAl Viro1-1/+0
io_remap_pfn_range() will set it just fine Signed-off-by: Al Viro <[email protected]>
2013-06-29consolidate io_remap_pfn_range definitionsAl Viro34-105/+7
Signed-off-by: Al Viro <[email protected]>
2013-06-29UBIFS: fix a horrid bugArtem Bityutskiy1-3/+27
Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are in the middle of 'ubifs_readdir()'. This means that 'file->private_data' can be freed while 'ubifs_readdir()' uses it, and this is a very bad bug: not only 'ubifs_readdir()' can return garbage, but this may corrupt memory and lead to all kinds of problems like crashes an security holes. This patch fixes the problem by using the 'file->f_version' field, which '->llseek()' always unconditionally sets to zero. We set it to 1 in 'ubifs_readdir()' and whenever we detect that it became 0, we know there was a seek and it is time to clear the state saved in 'file->private_data'. I tested this patch by writing a user-space program which runds readdir and seek in parallell. I could easily crash the kernel without these patches, but could not crash it with these patches. Cc: [email protected] Reported-by: Al Viro <[email protected]> Tested-by: Artem Bityutskiy <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: Al Viro <[email protected]>
2013-06-29UBIFS: prepare to fix a horrid bugArtem Bityutskiy1-12/+12
Al Viro pointed me to the fact that '->readdir()' and '->llseek()' have no mutual exclusion, which means the 'ubifs_dir_llseek()' can be run while we are in the middle of 'ubifs_readdir()'. First of all, this means that 'file->private_data' can be freed while 'ubifs_readdir()' uses it. But this particular patch does not fix the problem. This patch is only a preparation, and the fix will follow next. In this patch we make 'ubifs_readdir()' stop using 'file->f_pos' directly, because 'file->f_pos' can be changed by '->llseek()' at any point. This may lead 'ubifs_readdir()' to returning inconsistent data: directory entry names may correspond to incorrect file positions. So here we introduce a local variable 'pos', read 'file->f_pose' once at very the beginning, and then stick to 'pos'. The result of this is that when 'ubifs_dir_llseek()' changes 'file->f_pos' while we are in the middle of 'ubifs_readdir()', the latter "wins". Cc: [email protected] Reported-by: Al Viro <[email protected]> Tested-by: Artem Bityutskiy <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]> Signed-off-by: Al Viro <[email protected]>
2013-06-22aout32 coredump compat fixAl Viro1-1/+1
dump_seek() does SEEK_CUR, not SEEK_SET; native binfmt_aout handles it correctly (seeks by PAGE_SIZE - sizeof(struct user), getting the current position to PAGE_SIZE), compat one seeks by PAGE_SIZE and ends up at PAGE_SIZE + already written... Signed-off-by: Al Viro <[email protected]>
2013-06-20splice: don't pass the address of ->f_pos to methodsAl Viro5-23/+41
Signed-off-by: Al Viro <[email protected]>
2013-06-19mconsole: we'd better initialize pos before passing it to vfs_read()...Al Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2013-06-16lseek(fd, n, SEEK_END) does *not* go to eof - nAl Viro4-4/+4
When you copy some code, you are supposed to read it. If nothing else, there's a chance to spot and fix an obvious bug instead of sharing it... X-Song: "I Got It From Agnes", by Tom Lehrer Signed-off-by: Al Viro <[email protected]> [ Tom Lehrer? You're dating yourself, Al ] Signed-off-by: Linus Torvalds <[email protected]>
2013-06-15Linux 3.10-rc6Linus Torvalds1-1/+1
2013-06-15Merge tag 'fixes-for-linus' of ↵Linus Torvalds13-29/+96
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM SoC fixes from Olof Johansson: "These are a little later than I planned on since I got caught up with handling merges for 3.11 most of the week. Another week, another batch of fixes for arm-soc platforms. Again, nothing controversial. A few more than would be ideal, but all are valid fixes. In particular the prima2 panic patch is critical since it fixes a problem where multiplatform kernels panic on all but prima2 hardware." * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: SAMSUNG: pm: Adjust for pinctrl- and DT-enabled platforms ARM: prima2: fix incorrect panic usage arm: mvebu: armada-xp-{gp,openblocks-ax3-4}: specify PCIe range ARM: Kirkwood: handle mv88f6282 cpu in __kirkwood_variant(). ARM: omap3: clock: fix wrong container_of in clock36xx.c ARM: dts: OMAP5: Fix missing PWM capability to timer nodes ARM: dts: omap4-panda|sdp: Fix mux for twl6030 IRQ pin and msecure line ARM: dts: AM33xx: Fix properties on gpmc node arm: omap2: fix AM33xx hwmod infos for UART2 ARM: OMAP3: Fix iva2_pwrdm settings for 3703
2013-06-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds20-81/+147
Pull networking fixes from David Miller: 1) Fix RTNL locking in batman-adv, from Matthias Schiffer. 2) Don't allow non-passthrough macvlan devices to set NOPROMISC via netlink, otherwise we can end up with corrupted promisc counter values on the device. From Michael S Tsirkin. 3) Fix stmmac driver build with debugging defines enabled, from Dinh Nguyen. 4) Make sure name string we give in socket address in AF_PACKET is NULL terminated, from Daniel Borkmann. 5) Fix leaking of two uninitialized bytes of memory to userspace in l2tp, from Guillaume Nault. 6) Clear IPCB(skb) before tunneling otherwise we touch dangling IP options state and crash. From Saurabh Mohan. 7) Fix suspend/resume for davinci_mdio by using suspend_late and resume_early. From Mugunthan V N. 8) Don't tag ip_tunnel_init_net and ip_tunnel_delete_net with __net_{init,exit}, they can be called outside of those contexts. From Eric Dumazet. 9) Fix RX length error in sh_eth driver, from Yoshihiro Shimoda. 10) Fix missing sctp_outq initialization in some code paths of SCTP stack, from Neil Horman. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (21 commits) sctp: fully initialize sctp_outq in sctp_outq_init netiucv: Hold rtnl between name allocation and device registration. tulip: Properly check dma mapping result net: sh_eth: fix incorrect RX length error if R8A7740 ip_tunnel: remove __net_init/exit from exported functions drivers: net: davinci_mdio: restore mdio clk divider in mdio resume drivers: net: davinci_mdio: moving mdio resume earlier than cpsw ethernet driver net/ipv4: ip_vti clear skb cb before tunneling. tg3: Wait for boot code to finish after power on l2tp: Fix sendmsg() return value l2tp: Fix PPP header erasure and memory leak bonding: fix igmp_retrans type and two related races bonding: reset master mac on first enslave failure packet: packet_getname_spkt: make sure string is always 0-terminated net: ethernet: stmicro: stmmac: Fix compile error when STMMAC_XMIT_DEBUG used be2net: Fix 32-bit DMA Mask handling xen-netback: don't de-reference vif pointer after having called xenvif_put() macvlan: don't touch promisc without passthrough batman-adv: Don't handle address updates when bla is disabled batman-adv: forward late OGMs from best next hop ...