The patch titled Subject: ncpfs: don't allow negative timeouts has been added to the -mm tree. Its filename is ncpfs-dont-allow-negative-timeouts.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ncpfs-dont-allow-negative-timeouts.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ncpfs-dont-allow-negative-timeouts.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Subject: ncpfs: don't allow negative timeouts This code causes a static checker warning because it's a user controlled variable where we cap the upper bound but not the lower bound. Let's return an -EINVAL for negative timeouts. Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Reviewed-by: Jan Kara <jack@xxxxxxxx> Cc: Petr Vandrovec <petr@xxxxxxxxxxxxxx> Cc: David Howells <dhowells@xxxxxxxxxx> Cc: Jan Kara <jack@xxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ncpfs/ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN fs/ncpfs/ioctl.c~ncpfs-dont-allow-negative-timeouts fs/ncpfs/ioctl.c --- a/fs/ncpfs/ioctl.c~ncpfs-dont-allow-negative-timeouts +++ a/fs/ncpfs/ioctl.c @@ -525,7 +525,9 @@ static long __ncp_ioctl(struct inode *in switch (rqdata.cmd) { case NCP_LOCK_EX: case NCP_LOCK_SH: - if (rqdata.timeout == 0) + if (rqdata.timeout < 0) + return -EINVAL; + else if (rqdata.timeout == 0) rqdata.timeout = NCP_LOCK_DEFAULT_TIMEOUT; else if (rqdata.timeout > NCP_LOCK_MAX_TIMEOUT) rqdata.timeout = NCP_LOCK_MAX_TIMEOUT; _ Patches currently in -mm which might be from dan.carpenter@xxxxxxxxxx are ncpfs-dont-allow-negative-timeouts.patch mm-add-tracepoint-for-scanning-pages-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html