Re: [patch v2] mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()

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

 



On Thu, Dec 05, 2013 at 05:53:50PM +0300, Dan Carpenter wrote:
> We always put a NUL terminator one space past the end of the "vendor"
> buffer.  Walter Harms also pointed out that this should just use
> kstrndup().
> 
> Fixes: 7d17c02a01a1 ('mtd: Add new SmartMedia/xD FTL')
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Patch looks good.

> ---
> v2:  Use kstrndup().
>      Don't subtract 1 from the strnlen() limiter for the NUL.  I think
>      it's ok to go over?

I don't think you're "going over" anything. You're just (correctly)
allocating the buffer as (at most) one byte larger than (SM_SMALL_PAGE -
SM_CIS_VENDOR_OFFSET), which is perfect if you're copying up to
(SM_SMALL_PAGE - SM_CIS_VENDOR_OFFSET) bytes of character data.

Pushed to l2-mtd.git/next, queued for 3.15. Thanks.

Brian
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux