Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168Ab3IIDD5 (ORCPT ); Sun, 8 Sep 2013 23:03:57 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:37315 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431Ab3IIDDz (ORCPT ); Sun, 8 Sep 2013 23:03:55 -0400 MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 8 Sep 2013 23:03:53 -0400 Message-ID: Subject: Re: [052/121] cifs: extend the buffer length enought for sprintf() using From: Scott Lovenberg To: Ben Hutchings Cc: LKML , stable@vger.kernel.org, akpm@linux-foundation.org, Jeff Layton , Chen Gang , Shirish Pargaonkar , Steve French Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1448 Lines: 41 On Sat, Sep 7, 2013 at 10:52 PM, Ben Hutchings wrote: > > 3.2.51-rc1 review patch. If anyone has any objections, please let me know. > > ------------------ > > From: Chen Gang > > commit 057d6332b24a4497c55a761c83c823eed9e3f23b upstream. > > For cifs_set_cifscreds() in "fs/cifs/connect.c", 'desc' buffer length > is 'CIFSCREDS_DESC_SIZE' (56 is less than 256), and 'ses->domainName' > length may be "255 + '\0'". > > The related sprintf() may cause memory overflow, so need extend related > buffer enough to hold all things. > > It is also necessary to be sure of 'ses->domainName' must be less than > 256, and define the related macro instead of hard code number '256'. > > Signed-off-by: Chen Gang > Reviewed-by: Jeff Layton > Reviewed-by: Shirish Pargaonkar > Reviewed-by: Scott Lovenberg > Signed-off-by: Steve French > [bwh: Backported to 3.2: > - Adjust context in sess.c > - Drop inapplicable changes to connect.c] > Signed-off-by: Ben Hutchings Looks good to me. -- Peace and Blessings, -Scott. -- 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/