From patchwork Tue May 27 08:50:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Veli-Matti Lintu X-Patchwork-Id: 4248021 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 16A7A9F333 for ; Tue, 27 May 2014 08:49:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 518A420204 for ; Tue, 27 May 2014 08:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63237201FB for ; Tue, 27 May 2014 08:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751697AbaE0Ith (ORCPT ); Tue, 27 May 2014 04:49:37 -0400 Received: from api.opinsys.fi ([217.112.254.4]:58689 "EHLO mail.opinsys.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751406AbaE0Itg (ORCPT ); Tue, 27 May 2014 04:49:36 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.opinsys.fi (Postfix) with ESMTP id 8A3AC26519E; Tue, 27 May 2014 08:50:36 +0000 (UTC) Received: from mail.opinsys.fi ([127.0.0.1]) by localhost (mail.opinsys.fi [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NvZ34jOZdhQv; Tue, 27 May 2014 08:50:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.opinsys.fi (Postfix) with ESMTP id 620412651A2; Tue, 27 May 2014 08:50:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at opinsys.fi Received: from mail.opinsys.fi ([127.0.0.1]) by localhost (mail.opinsys.fi [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id ftTb8TehSKVL; Tue, 27 May 2014 08:50:27 +0000 (UTC) Received: from mail.opinsys.fi (mail.opinsys.fi [10.246.133.21]) by mail.opinsys.fi (Postfix) with ESMTP id 3967526519E; Tue, 27 May 2014 08:50:27 +0000 (UTC) Date: Tue, 27 May 2014 08:50:26 +0000 (UTC) From: Veli-Matti Lintu To: steved@redhat.com Cc: linux-nfs@vger.kernel.org, Tuomas =?utf-8?B?UsOkc8OkbmVu?= , Jeff Layton Message-ID: <41011674.48947.1401180626967.JavaMail.zimbra@opinsys.fi> In-Reply-To: <454183694.48823.1401178027425.JavaMail.zimbra@opinsys.fi> Subject: [PATCH] gssd: Fix allocated buffer size for the scraped acceptor name in do_downcall MIME-Version: 1.0 X-Originating-IP: [83.145.240.143] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF28 (Linux)/8.0.6_GA_5922) Thread-Topic: gssd: Fix allocated buffer size for the scraped acceptor name in do_downcall Thread-Index: wkcOspPLvocbjhZOJb+PdRYqh5xNhg== Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In commit 51fda07a "gssd: scrape the acceptor name out of the context" the allocated buffer size is not large enough to hold the actual data that is written to the buffer. This fixes the allocated buffer size. Signed-off-by: Veli-Matti Lintu Reviewed-by: Jeff Layton --- utils/gssd/gssd_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c index 69bb3c6..40ff188 100644 --- a/utils/gssd/gssd_proc.c +++ b/utils/gssd/gssd_proc.c @@ -696,7 +696,7 @@ do_downcall(int k5_fd, uid_t uid, struct authgss_private_data *pd, buf_size = sizeof(uid) + sizeof(timeout) + sizeof(pd->pd_seq_win) + sizeof(pd->pd_ctx_hndl.length) + pd->pd_ctx_hndl.length + sizeof(context_token->length) + context_token->length + - acceptor->length; + sizeof(acceptor->length) + acceptor->length; p = buf = malloc(buf_size); if (!buf) goto out_err;