From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757453Ab0JQRqY (ORCPT ); Sun, 17 Oct 2010 13:46:24 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:36578 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757434Ab0JQRqV (ORCPT ); Sun, 17 Oct 2010 13:46:21 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=i/tZ22L3hNE227KXJAlic2BwI38chHkMXthov/ic6kz7usXMm32vSBPrglz2hciwFJ xzV9lisnnNArpzY6Eg/2gRHsHd5aQxnuhaDiEdyxwTGU7xM18tqhybFJ4JCYi/3E2PPH BMD1s5QVlQBkAyj9pBCoZzoGx1cygp1Y86tc0= Message-ID: <4CBB3667.2010804@suse.cz> Date: Sun, 17 Oct 2010 19:46:15 +0200 From: Jiri Slaby User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; cs-CZ; rv:1.9.2.9) Gecko/20100914 SUSE/3.1.4 Thunderbird/3.1.4 MIME-Version: 1.0 To: Vasiliy Kulikov CC: kernel-janitors@vger.kernel.org, Greg Kroah-Hartman , Alan Cox , Arnd Bergmann , linux-kernel@vger.kernel.org Subject: Re: [PATCH 6/8] char: synclink: fix information leak to userland References: <1287326493-8134-1-git-send-email-segooon@gmail.com> <4CBB177C.9050007@suse.cz> <20101017153839.GA11029@albatros> In-Reply-To: <20101017153839.GA11029@albatros> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/2010 05:38 PM, Vasiliy Kulikov wrote: > On Sun, Oct 17, 2010 at 17:34 +0200, Jiri Slaby wrote: >> On 10/17/2010 04:41 PM, Vasiliy Kulikov wrote: >>> Structure new_line is copied to userland with some padding fields unitialized. >>> It leads to leaking of stack memory. >> >> I think your tool has a bug. I must admit I fail to see the padding >> which would cause leaks. Could you elaborate? > > I didn't use any tool except "grep copy_to_user" :) > > typedef struct { > unsigned int clock_rate; /* bits per second */ > unsigned int clock_type; /* internal, external, TX-internal etc. */ > unsigned short loopback; > } sync_serial_settings; /* V.35, V.24, X.21 */ > > On x86_64 sizeof(sync_serial_settings) = 4 + 4 + 2 + 2 = 12. > The last 2 is padding. Ah, good to know that even end of structures is padded. thanks for clarification, -- js suse labs