Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp60510ybg; Mon, 27 Jul 2020 15:36:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYMy+/pPAw1IZowyhPgy2WFY3B2Z0OO476ZklpNoMGApenpOU0k9t5bDIS2dSPk8B6lNRn X-Received: by 2002:a17:906:a3d5:: with SMTP id ca21mr7303976ejb.453.1595889388181; Mon, 27 Jul 2020 15:36:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595889388; cv=none; d=google.com; s=arc-20160816; b=irzIfcym/kQmtKf9iXoVAeYmLU1ouDKaBT5kPyB0I64XTqxNNnbels36312NCRL5xs +s1Bh7wk3ux+QPwNfQKmYaam040JT8B99n36Kl6TBu1earWN5Kuk2ALuilY+ePmScmOs hiVug2REizXoLZowhyhH6Sft9u6wHscXRWlKqy5fj57ux8vbToNouGNfKk16tj25nGkX FtgeH7H1vgdVkDjyMb0JNpPVxih3R7l24r9EQ+BRkykdCesSlzcHteEuZA/s2gK8vX5K 3hhkiGNga/d4LUatiLcI0gmPSAGW2N+ltM8rkUdG56WT024bOB2wDOw1k50Gln3ZHfmU +4Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=qdRJPfeh5unLgeU8AmitK4ZcKNveusAvABQiizyUCDs=; b=nxZu1RO1MMVVyOTiTPAV162XYUPDAHRzp5GxCsr1/fvEyDL3hDxHWY15m+oFCX2fra xpP9IWbxqubY9edOHWpntF0nki+Q7n1r7x7d5x0NIXQyRqcruahSSZmDtDBmZk4NixnF Ualb3DZw+HFKJxOkEViXdp0bAqNJ8dK3m0D7M9mLl4G6Sa8OGRRZdppjsoD04dDFdmzZ /taAMk4sfQcLiit52DWfKt/unChbgQk4eA4iMaKj6w+Pt/GoV1wI3IsnJ0dsm9g5y0EV LYCHRvpT8TpWdyKbHdtWFeKKhE6iX/MyKTFSdiA3y7gGOs+vEqbVdZmPd/gF1R82pVFE Lb1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hh3U81Gh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si2590709edt.100.2020.07.27.15.36.01; Mon, 27 Jul 2020 15:36:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hh3U81Gh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726731AbgG0WeB (ORCPT + 99 others); Mon, 27 Jul 2020 18:34:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726171AbgG0WeA (ORCPT ); Mon, 27 Jul 2020 18:34:00 -0400 Received: from mail-qv1-xf42.google.com (mail-qv1-xf42.google.com [IPv6:2607:f8b0:4864:20::f42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E573C061794 for ; Mon, 27 Jul 2020 15:34:00 -0700 (PDT) Received: by mail-qv1-xf42.google.com with SMTP id di5so8247071qvb.11 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=Ut1DxrfjlRFQlLAUQvo9R1dAkb4E4MJOsMDHrxi8nIpPncg8XStrqbUW9Iyfn301m/ 5JBFwpXmsg/yweswyjgd4KqgJ6m+pJEnzxpkzCYxXRrScF06/kIzC7NP1On0tvI7L5m0 TxfCIGeNU5f3w/wu6oBseCzUAcMdDoBMoxXm4Tw7AUW3/oEcj6RdHSQb5S+pXYqTZ5Xh 81ix9XblvCBeWhxtNfZGpSS5TZKUm9j3EEYEvrLYMrKEL009n4DOri5LgqXojwqS2l07 1tJd3M+9rM766KTDsb2PGS1fUq2NFbk0oNtsAlDnDzi9vzsGZqvAgUYfEHo4chI/U/dj OQZg== X-Gm-Message-State: AOAM533z7RfDJZYt1f2LM+9pA3vVHOp5RfN/ErS+C+sIvJxyL7b9Ze7X xRFEMVFXWdD83Ow06lc74P0aT5JnOA== 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 Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel-mentees@lists.linuxfoundation.org, "linux-kernel@vger.kernel.org" Subject: Re: [Linux-kernel-mentees] [PATCH v3] media/v4l2-core: Fix kernel-infoleak in video_put_user() 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200727131608.GD1913@kadam> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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