aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
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-28efivars: If pstore_register fails, free unneeded pstore bufferLenny Szubowicz1-1/+5
This is patch 3/3 of a patch set that cleans up pstore_register failure paths. If efivars fails to register with pstore, there is no point to keeping the 4 KB buffer around. It's only used by the pstore read/write routines. Signed-off-by: Lenny Szubowicz <[email protected]> Reported-by: Naotaka Hamaguchi <[email protected]> Signed-off-by: Tony Luck <[email protected]>
2013-06-28acpi: Eliminate console msg if pstore.backend excludes ERSTLenny Szubowicz1-6/+14
This is patch 2/3 of a patch set that avoids what misleadingly appears to be a error during boot: ERST: Could not register with persistent store This message is displayed if the system has a valid ACPI ERST table and the pstore.backend kernel parameter has been used to disable use of ERST by pstore. But this same message is used for errors that preclude registration. In erst_init don't complain if the setting of kernel parameter pstore.backend precludes use of ACPI ERST for pstore. Routine pstore_register will inform about the facility that does register. Also, don't leave a dangling pointer to deallocated mem for the pstore buffer when registration fails. Signed-off-by: Lenny Szubowicz <[email protected]> Reported-by: Naotaka Hamaguchi <[email protected]> Signed-off-by: Tony Luck <[email protected]>
2013-06-28pstore: Return unique error if backend registration excluded by kernel paramLenny Szubowicz1-5/+6
This is patch 1/3 of a patch set that avoids what misleadingly appears to be a error during boot: ERST: Could not register with persistent store This message is displayed if the system has a valid ACPI ERST table and the pstore.backend kernel parameter has been used to disable use of ERST by pstore. But this same message is used for errors that preclude registration. As part of fixing this, return a unique error status from pstore_register if the pstore.backend kernel parameter selects a specific facility other than the requesting facility and check for this condition before any others. This allows the caller to distinquish this benign case from the other failure cases. Also, print an informational console message about which facility successfully registered as the pstore backend. Since there are various kernel parameters, config build options, and boot-time errors that can influence which facility registers with pstore, it's useful to have a positive indication. Signed-off-by: Lenny Szubowicz <[email protected]> Reported-by: Naotaka Hamaguchi <[email protected]> Signed-off-by: Tony Luck <[email protected]>
2013-06-28mn10300: Use early_param() to parse "mem=" parameterAkira Takeuchi1-33/+21
This fixes the problem that "init=" options may not be passed to kernel correctly. parse_mem_cmdline() of mn10300 arch gets rid of "mem=" string from redboot_command_line. Then init_setup() parses the "init=" options from static_command_line, which is a copy of redboot_command_line, and keeps the pointer to the init options in execute_command variable. Since the commit 026cee0 upstream (params: <level>_initcall-like kernel parameters), static_command_line becomes overwritten by saved_command_line at do_initcall_level(). Notice that saved_command_line is a command line which includes "mem=" string. As a result, execute_command may point to weird string by the length of "mem=" parameter. I noticed this problem when using the command line like this: mem=128M console=ttyS0,115200 init=/bin/sh Here is the processing flow of command line parameters. start_kernel() setup_arch(&command_line) parse_mem_cmdline(cmdline_p) * strcpy(boot_command_line, redboot_command_line); * Remove "mem=xxx" from redboot_command_line. * *cmdline_p = redboot_command_line; setup_command_line(command_line) <-- command_line is redboot_command_line * strcpy(saved_command_line, boot_command_line) * strcpy(static_command_line, command_line) parse_early_param() strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE); parse_early_options(tmp_cmdline); parse_args("early options", cmdline, NULL, 0, 0, 0, do_early_param); parse_args("Booting ..", static_command_line, ...); init_setup() <-- save the pointer in execute_command rest_init() kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND); At this point, execute_command points to "/bin/sh" string. kernel_init() kernel_init_freeable() do_basic_setup() do_initcalls() do_initcall_level() (*) strcpy(static_command_line, saved_command_line); Here, execute_command gets to point to "200" string !! Signed-off-by: David Howells <[email protected]>
2013-06-28mn10300: Allow to pass array name to get_user()Akira Takeuchi1-1/+1
This fixes the following compile error: CC block/scsi_ioctl.o block/scsi_ioctl.c: In function 'sg_scsi_ioctl': block/scsi_ioctl.c:449: error: invalid initializer Signed-off-by: David Howells <[email protected]>
2013-06-28softirq: Use _RET_IP_Davidlohr Bueso1-6/+4
Use the already defined macro to pass the function return address. Signed-off-by: Davidlohr Bueso <[email protected]> Cc: Frederic Weisbecker <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Thomas Gleixner <[email protected]>
2013-06-28sched/debug: Remove CONFIG_FAIR_GROUP_SCHED maskAlex Shi1-4/+6
Now that we are using runnable load avg in sched balance, we don't need to keep it under CONFIG_FAIR_GROUP_SCHED. Also align the code style to #ifdef instead of #if defined() and reorder the tg output info. Signed-off-by: Alex Shi <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2013-06-28genirq: Add the generic chip to the genirq docbookThomas Gleixner2-5/+19
Signed-off-by: Thomas Gleixner <[email protected]> Cc: Randy Dunlap <[email protected]>