> -----Original Message-----
> From: Alan [mailto:[email protected]]
> Sent: Wednesday, December 11, 2013 10:31 AM
> To: [email protected]; Kirsher, Jeffrey T
> Subject: [E1000-devel] [PATCH] i40e: Fix off by one in
> i40e_dbg_command_write
> 
> We assume that the resulting buffer is zero terminated when we then
> re-use it. The sscanf is limited to 512 bytes but needs to be 511
> to allow for a terminator.
> 
> One of a set of problems noted by Jackie Chang
> 
> Signed-off-by: Alan Cox <[email protected]>

Acked-by: Shannon Nelson <[email protected]>

> ---
>  drivers/net/ethernet/intel/i40e/i40e_debugfs.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> index 9c675b5..ba23f7f 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_debugfs.c
> @@ -1568,7 +1568,7 @@ static ssize_t i40e_dbg_command_write(struct file
> *filp,
>               if (strncmp(cmd_buf, "add", 3) == 0)
>                       add = true;
>               cnt = sscanf(&cmd_buf[13],
> -                          "%hx %2hhx %2hhx %hx %2hhx %2hhx %hx %x %hd %512s",
> +                          "%hx %2hhx %2hhx %hx %2hhx %2hhx %hx %x %hd %511s",
>                            &fd_data.q_index,
>                            &fd_data.flex_off, &fd_data.pctype,
>                            &fd_data.dest_vsi, &fd_data.dest_ctl,
> 
> 
> ------------------------------------------------------------------------
> ------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into
> your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of
> AppDynamics Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clk
> trk
> _______________________________________________
> E1000-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/e1000-devel
> To learn more about Intel&#174; Ethernet, visit
> http://communities.intel.com/community/wired

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to