[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#741955: linux: ssize_t casted to unsigned int in fs/cifs/file.c when CONFIG_CIFS_STATS is set



Source: linux
Version: 3.2.54-2
Severity: minor

Hi,

Similar to my previous bug report, I noticed that cifs_iovec_write
sets the sszie_t 'total_written' to 'rc'[1] but at a later point it
calls cifs_stats_bytes_written[2] with that <0 value.
When CONFIG_CIFS_STATS is set, it casts what is passed from
'total_written' as an unsigned int and then increases a counter
(tcon->bytes_written) with it.

Have not checked what could happen later on.

This seems to have been fixed in 3.4 with the move to async writes
with da82f7e755d2808ba726c9b23267d5bb23980e94.

[1}http://sources.debian.net/src/linux/3.2.54-2/fs/cifs/file.c#L2204
[2]http://sources.debian.net/src/linux/3.2.54-2/fs/cifs/file.c#L2219

Cheers,
-- 
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net


Reply to: