Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1207077

Re: [PATCH] staging: wilc1000: Process WARN, INFO options of debug levels from user

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: wilc1000: Process WARN, INFO options of debug levels from user
Date 2015-08-13 21:10 +0200
Message-ID <pX630-3Qo-35@gated-at.bofh.it> (permalink)
References <pWIan-2Ol-43@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 12, 2015 at 11:05:58PM +0530, Chandra S Gorentla wrote:
> -	if (copy_from_user(buffer, buf, count)) {
> +	ret = simple_write_to_buffer(buffer, sizeof(buffer), ppos, buf, count);

This part doesn't make sense.  Use copy_from_user().  Also it's not NUL
terminated so it leads to a read past the end of the array later.  In
the original code, we just looked at the first char and didn't use
kstrtoint() so we didn't care about NUL termination.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] staging: wilc1000: Process WARN, INFO options of debug levels from user Chandra S Gorentla <csgorentla@gmail.com> - 2015-08-12 19:40 +0200
  Re: [PATCH] staging: wilc1000: Process WARN, INFO options of debug  levels from user Dan Carpenter <dan.carpenter@oracle.com> - 2015-08-13 21:10 +0200

csiph-web