From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58CBEC433DF for ; Mon, 27 Jul 2020 22:34:43 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 192F220729 for ; Mon, 27 Jul 2020 22:34:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hh3U81Gh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 192F220729 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CC1F487909; Mon, 27 Jul 2020 22:34:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ojD6-V3UbYjd; Mon, 27 Jul 2020 22:34:42 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 08DB687695; Mon, 27 Jul 2020 22:34:42 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EE773C004F; Mon, 27 Jul 2020 22:34:41 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 2136EC004D for ; Mon, 27 Jul 2020 22:34:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 95AAB22735 for ; Mon, 27 Jul 2020 22:34:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YTplrWGQP4Zr for ; Mon, 27 Jul 2020 22:34:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) by silver.osuosl.org (Postfix) with ESMTPS id A2917226FF for ; Mon, 27 Jul 2020 22:34:00 +0000 (UTC) Received: by mail-qv1-f67.google.com with SMTP id o2so8269549qvk.6 for ; Mon, 27 Jul 2020 15:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=qdRJPfeh5unLgeU8AmitK4ZcKNveusAvABQiizyUCDs=; b=hh3U81GhCy8kQSwX8BCigvuYF0zagijulCGFoytEaIYbrGxnz4puPKlCb9AuPxk+aF 2Quut0UsjOaOClJRMvcjQjVts5Sm6ipo3/Hktv7Iep6RzEfEsHKgOoiUlN6IWLwc0J9L PrFlFUwd7PqM4vj2owBZuLDLHCugFabY/GeNK/iiKjUpSYfYv/lxgBUNisVgzeZu/26Y epEqhW8VSn0VRxB8QKM5y7aPJpsTl7Z4JbQwqZjKIs/nmo3VX1F4OBNbKPctT0Jt4DEh T6wwYLfXTcFheUSUkCnjuU2m8FTj8iviMFQuZejdEXBCcs0BeglwCcJKn3CbgOy5IuK+ xHuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=qdRJPfeh5unLgeU8AmitK4ZcKNveusAvABQiizyUCDs=; b=fvGkIPBV8KUA9+sIAVwyPDVH44nUmVkH9tDg9b9BYMHwlDjclmS1rKpuzTTAZv31B1 /B7CwWCnpswPUj9TUhJCfLdAwH8QkQdTqyE4ZhGRt0N+GoSCCXUTHLprKKukwJV8P7dD vMdB877j+Vp21OPAfvegjmRUBHR8Kdcph3xSvHjPiz/63VYrIqp93q1thwTjXgRbULTL 5tE7EGTus8cqrirDYOnsL3JzZqnGUD31mdIoaS97Kgbp659BT/OU1mhOcHOcmH6dUsT6 21gwn8UPA5NyIlT2oYgnVOMpqpfGt+V++Pj6HAih3YkOgyuajf9OwCkn0yvPF5j+Mkui Y8xA== X-Gm-Message-State: AOAM532q//d1G3J0q7IAlfTLJY21tZ8zqIkzH0qOsU3aO7dR3zf5dfrR z0sSFIpAnngQQMMiFg/qTw== X-Google-Smtp-Source: ABdhPJwZ1I1WmUcL7yD7/isTmdXBnVJZX/XmomlAIyrrdEd1/vNKh8c+rv/2d9uwmtKD0r5KESK3iQ== X-Received: by 2002:a0c:a306:: with SMTP id u6mr24953891qvu.88.1595889239764; Mon, 27 Jul 2020 15:33:59 -0700 (PDT) Received: from PWN ([209.94.141.207]) by smtp.gmail.com with ESMTPSA id n68sm21044944qkd.89.2020.07.27.15.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 15:33:59 -0700 (PDT) Date: Mon, 27 Jul 2020 18:33:57 -0400 From: Peilin Ye To: Dan Carpenter Message-ID: <20200727223357.GA329006@PWN> References: <20200726220557.102300-1-yepeilin.cs@gmail.com> <20200726222703.102701-1-yepeilin.cs@gmail.com> <20200727131608.GD1913@kadam> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200727131608.GD1913@kadam> Cc: linux-kernel-mentees@lists.linuxfoundation.org, "linux-kernel@vger.kernel.org" , Arnd Bergmann Subject: Re: [Linux-kernel-mentees] [PATCH v3] media/v4l2-core: Fix kernel-infoleak in video_put_user() X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Mon, Jul 27, 2020 at 04:16:08PM +0300, Dan Carpenter wrote: > drivers/block/floppy.c:3132 raw_cmd_copyout() warn: check that 'cmd' doesn't leak information (struct has a hole after 'flags') (Removed some Cc: recipients from the list.) I'm not very sure, but I think this one is also a false positive. Here Smatch is complaining about a linked list called `my_raw_cmd` defined in raw_cmd_ioctl(): drivers/block/floppy.c:3249: ret = raw_cmd_copyin(cmd, param, &my_raw_cmd); In raw_cmd_copyin(), each element of the linked list is allocated by kmalloc() then copied from user: drivers/block/floppy.c:3180: loop: ptr = kmalloc(sizeof(struct floppy_raw_cmd), GFP_KERNEL); ^^^^^^^ if (!ptr) return -ENOMEM; *rcmd = ptr; ret = copy_from_user(ptr, param, sizeof(*ptr)); ^^^^^^^^^^^^^^ I think copy_from_user() is filling in the paddings inside `struct floppy_raw_cmd`? Thank you, Peilin Ye _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees