linux-uconsole/fs
Suresh Jayaraman 2aa9e27ee0 cifs: Fix a kernel BUG with remote OS/2 server (try #3)
commit 6513a81e93 upstream.

While chasing a bug report involving a OS/2 server, I noticed the server sets
pSMBr->CountHigh to a incorrect value even in case of normal writes. This
results in 'nbytes' being computed wrongly and triggers a kernel BUG at
mm/filemap.c.

void iov_iter_advance(struct iov_iter *i, size_t bytes)
{
        BUG_ON(i->count < bytes);    <--- BUG here

Why the server is setting 'CountHigh' is not clear but only does so after
writing 64k bytes. Though this looks like the server bug, the client side
crash may not be acceptable.

The workaround is to mask off high 16 bits if the number of bytes written as
returned by the server is greater than the bytes requested by the client as
suggested by Jeff Layton.

Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-26 07:41:23 -07:00
..
9p fix oops in fs/9p late mount failure 2010-02-09 04:50:46 -08:00
adfs adfs: remove redundant test on unsigned 2009-09-24 07:21:05 -07:00
affs fix affs parse_options() 2010-02-09 04:50:48 -08:00
afs FS-Cache: Handle pages pending storage that get evicted under OOM conditions 2009-11-19 18:11:35 +00:00
autofs trivial: remove unnecessary semicolons 2009-09-21 15:14:58 +02:00
autofs4 autofs4 - fix missed case when changing to use struct path 2009-08-31 17:44:05 -10:00
befs befs: fix leak 2010-02-23 07:37:55 -08:00
bfs Fix failure exits in bfs_fill_super() 2010-02-09 04:50:46 -08:00
btrfs Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable 2009-11-11 13:38:59 -08:00
cachefiles CacheFiles: Update IMA counters when using dentry_open 2009-12-01 07:35:11 -08:00
cifs cifs: Fix a kernel BUG with remote OS/2 server (try #3) 2010-04-26 07:41:23 -07:00
coda headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
configfs writeback: add name to backing_dev_info 2009-09-11 09:20:26 +02:00
cramfs
debugfs debugfs: fix create mutex racy fops and private data 2009-12-18 14:04:16 -08:00
devpts devpts_get_tty() should validate inode 2009-12-18 14:04:15 -08:00
dlm dlm: fix socket fd translation 2009-09-30 12:19:44 -05:00
ecryptfs eCryptfs: Add getattr function 2010-02-23 07:37:58 -08:00
efs get rid of BKL in fs/efs 2009-06-17 00:36:36 -04:00
exofs exofs: simple_write_end does not mark_inode_dirty 2010-01-18 10:19:15 -08:00
exportfs
ext2 Merge branch 'hwpoison' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-mce-2.6 2009-09-24 07:53:22 -07:00
ext3 ext3: journal all modifications in ext3_xattr_set_handle 2010-04-26 07:41:21 -07:00
ext4 ext4: fix sleep inside spinlock issue with quota and dealloc (#14739) 2010-01-06 15:05:06 -08:00
fat fat: fix buffer overflow in vfat_create_shortname() 2010-04-26 07:41:13 -07:00
freevxfs headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
fscache FS-Cache: Provide nop fscache_stat_d() if CONFIG_FSCACHE_STATS=n 2009-11-20 21:50:44 +00:00
fuse mm: flush dcache before writing into page to avoid alias 2010-02-09 04:50:59 -08:00
gfs2 GFS2: Skip check for mandatory locks when unlocking 2010-04-01 15:58:57 -07:00
hfs hfs: fix a potential buffer overflow 2009-12-18 14:04:08 -08:00
hfsplus hfsplus: refuse to mount volumes larger than 2TB 2009-10-29 07:39:27 -07:00
hostfs hostfs: set maximum filesize in superblock for proper LFS support 2009-06-30 18:56:03 -07:00
hpfs headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
hppfs
hugetlbfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-09-24 08:32:11 -07:00
isofs fs: Make unload_nls() NULL pointer safe 2009-09-24 07:47:42 -04:00
jbd fs/jbd: Export log_start_commit to fix ext3 build. 2009-11-12 10:24:12 +01:00
jbd2 jbd2: don't wipe the journal on a failed journal checksum 2009-12-18 14:03:56 -08:00
jffs2 jffs2: Fix long-standing bug with symlink garbage collection. 2009-12-18 14:05:52 -08:00
jfs fs: Make unload_nls() NULL pointer safe 2009-09-24 07:47:42 -04:00
lockd headers: utsname.h redux 2009-09-23 18:13:10 -07:00
minix V3 minixfs: add missing directory type checking 2009-09-23 07:39:57 -07:00
ncpfs const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
nfs NFS: Prevent another deadlock in nfs_release_page() 2010-04-01 15:58:29 -07:00
nfs_common
nfsd vfs: take f_lock on modifying f_mode after open time 2010-03-15 08:49:37 -07:00
nilfs2 nilfs2: deleted inconsistent comment in nilfs_load_inode_block() 2009-11-15 17:17:46 +09:00
nls Merge git://git.kernel.org/pub/scm/linux/kernel/git/hirofumi/fatfs-2.6 2009-09-30 09:31:14 -07:00
notify inotify: only warn once for inotify problems 2010-01-22 15:17:56 -08:00
ntfs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6 2009-09-24 08:32:11 -07:00
ocfs2 ocfs2: Only bug out in direct io write for reflinked extent. 2010-03-15 08:50:04 -07:00
omfs const: constify remaining file_operations 2009-10-01 16:11:11 -07:00
openpromfs
partitions fs/partition/msdos: fix unusable extended partition for > 512B sector 2010-04-01 15:58:44 -07:00
proc oom: fix the unsafe usage of badness() in proc_oom_score() 2010-04-26 07:41:13 -07:00
qnx4 qnx4: remove write support 2009-09-23 07:39:30 -07:00
quota quota: Fix warning when a delayed write happens before quota is enabled 2010-04-01 15:58:54 -07:00
ramfs truncate: use new helpers 2009-09-24 08:41:47 -04:00
reiserfs reiserfs: truncate blocks not used by a write 2010-01-22 15:18:23 -08:00
romfs fix leak in romfs_fill_super() 2010-02-09 04:50:47 -08:00
smbfs fs: Make unload_nls() NULL pointer safe 2009-09-24 07:47:42 -04:00
squashfs const: mark remaining super_operations const 2009-09-22 07:17:24 -07:00
sysfs sysfs: sysfs_sd_setattr set iattrs unconditionally 2010-02-23 07:37:56 -08:00
sysv get rid of BKL in fs/sysv 2009-06-17 00:36:37 -04:00
ubifs const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
udf udf: Try harder when looking for VAT inode 2010-01-06 15:05:00 -08:00
ufs ufs: sector_t cannot be negative 2009-06-18 13:03:46 -07:00
xfs xfs: fix locking for inode cache radix tree tag updates 2010-04-26 07:41:16 -07:00
aio.c aio.c: move EXPORT* macros to line after function 2009-09-23 07:39:29 -07:00
anon_inodes.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
attr.c truncate: new helpers 2009-09-24 08:41:47 -04:00
bad_inode.c
binfmt_aout.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_elf.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_elf_fdpic.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_em86.c
binfmt_flat.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
binfmt_misc.c
binfmt_script.c
binfmt_som.c Split 'flush_old_exec' into two functions 2010-02-09 04:50:49 -08:00
bio-integrity.c block: fix bugs in bio-integrity mempool usage 2010-02-09 04:50:58 -08:00
bio.c block: fix bio_add_page for non trivial merge_bvec_fn case 2010-02-09 04:50:58 -08:00
block_dev.c raw: fsync method is now required 2010-04-26 07:41:19 -07:00
buffer.c Merge branch 'writeback' of git://git.kernel.dk/linux-2.6-block 2009-09-25 09:27:30 -07:00
char_dev.c fs/char_dev.c: remove useless loop 2009-09-24 07:21:03 -07:00
compat.c x86, fs: Fix x86 procfs stack information for threads on 64-bit 2009-11-04 13:25:03 +01:00
compat_binfmt_elf.c
compat_ioctl.c fs: add missing compat_ptr handling for FS_IOC_RESVSP ioctl 2009-11-12 07:25:57 -08:00
dcache.c sched: Pull up the might_sleep() check into cond_resched() 2009-07-18 15:51:44 +02:00
dcookies.c
direct-io.c
drop_caches.c sysctl: remove "struct file *" argument of ->proc_handler 2009-09-24 07:21:04 -07:00
eventfd.c anonfd: split interface into file creation and install 2009-09-23 07:39:29 -07:00
eventpoll.c epoll: fix nested calls support 2009-06-18 13:03:41 -07:00
exec.c coredump: suppress uid comparison test if core output files are pipes 2010-04-01 15:58:13 -07:00
fcntl.c Fix race in tty_fasync() properly 2010-02-23 07:37:44 -08:00
fifo.c
file.c headers: remove sched.h from interrupt.h 2009-10-11 11:20:58 -07:00
file_table.c vfs: take f_lock on modifying f_mode after open time 2010-03-15 08:49:37 -07:00
filesystems.c
fs-writeback.c writeback: pass in super_block to bdi_start_writeback() 2009-09-26 00:10:40 +02:00
fs_struct.c
generic_acl.c
inode.c vfs: optimize touch_time() too 2009-09-24 07:47:27 -04:00
internal.h fs: fix overflow in sys_mount() for in-kernel calls 2009-09-24 08:40:15 -04:00
ioctl.c __generic_block_fiemap(): fix for files bigger than 4GB 2009-11-12 07:26:01 -08:00
ioprio.c
Kconfig powerpc: Cleanup Kconfig selection of hugetlbfs support 2009-10-30 15:03:54 +11:00
Kconfig.binfmt
libfs.c libfs: return error code on failed attr set 2009-09-24 07:47:30 -04:00
locks.c const: make lock_manager_operations const 2009-09-22 07:17:25 -07:00
Makefile
mbcache.c
mpage.c
namei.c fix LOOKUP_FOLLOW on automount "symlinks" 2010-03-15 08:49:32 -07:00
namespace.c fs: fix overflow in sys_mount() for in-kernel calls 2009-09-24 08:40:15 -04:00
nfsctl.c
no-block.c
open.c fs: change sys_truncate length parameter type 2009-09-23 09:21:05 -07:00
pipe.c fs: pipe.c null pointer dereference 2009-10-22 08:11:44 +09:00
pnode.c
pnode.h
posix_acl.c
read_write.c vfs: remove redundant position check in do_sendfile 2009-09-24 07:47:34 -04:00
read_write.h
readdir.c
select.c headers: remove sched.h from poll.h 2009-10-04 15:05:10 -07:00
seq_file.c vfs: seq_file: add helpers for data filling 2009-09-24 07:47:35 -04:00
signalfd.c
splice.c Merge branch 'for-2.6.32' of git://git.kernel.dk/linux-2.6-block 2009-09-14 17:55:15 -07:00
stack.c
stat.c Add unlocked version of inode_add_bytes() function 2010-01-06 15:05:01 -08:00
super.c vfs: get_sb_single() - do not pass options twice 2010-01-28 15:00:47 -08:00
sync.c fs/buffer.c: clean up EXPORT* macros 2009-09-23 07:39:29 -07:00
timerfd.c
utimes.c
xattr.c VFS: Factor out part of vfs_setxattr so it can be called from the SELinux hook for inode_setsecctx. 2009-09-10 10:11:22 +10:00
xattr_acl.c