Message ID | 20220502113857.2126299-1-ovidiu.panait@windriver.com |
---|---|
State | New |
Headers | show
Return-Path: <stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C8FC433F5 for <stable@archiver.kernel.org>; Mon, 2 May 2022 11:39:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350642AbiEBLnU (ORCPT <rfc822;stable@archiver.kernel.org>); Mon, 2 May 2022 07:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232611AbiEBLnT (ORCPT <rfc822;stable@vger.kernel.org>); Mon, 2 May 2022 07:43:19 -0400 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7302B165A0 for <stable@vger.kernel.org>; Mon, 2 May 2022 04:39:50 -0700 (PDT) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 242B1Vo8012304; Mon, 2 May 2022 11:39:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=PPS06212021; bh=qTRPnvwLd7T4i4bIc4d37Y/ZiU5xEXXJs/iJnhDpsMg=; b=rRqeFyTko2dFSkUT4bSriwQ/3rDiaBz3LTc+qWawNr18bxt5br+Y+4mnWwL+RjALAeNW 9Ja7T8RsFyMtRdeJt3HDWAxba0JxnTV5mcRa4CKQ+GD/kRRmEX798bWgEZv1hvr6HU1r iSsJcxXj6AW6gV0Dg8RLweSazKbIdeBXRCz08To7oWEXEs6UPfxaLmAYL3WaoMvEjRzZ LJZcfVJpz2vDj0L/IoizuiFezmXcSeQpKrObGFG91YAQJlTsap6jIS6fT//PEPj1NzQN CNwDPEkzRnyjoUY5HeZuz6bacN5cC9TXceckW1tynDQRzga7rr3POx1WpiqlaYfGfw58 GQ== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2171.outbound.protection.outlook.com [104.47.57.171]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 3frtb0hc83-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 02 May 2022 11:39:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dXV18AydyeENQ5fmAv57e50qJAJDTF9J+FBPJbYjM1Ahw6VOrmrFAiHBXzvFOiY7gUOZL3UMZwqtRPL8//wlujqAFk43DBXinGdeXGY0ZlM+Q1KVkpZU/PAnj9nOo0EuIeP1wBx7xibXaJG1sQYMT0017Tm4Dkag7ggPzOHTwvIfwVrXxVKBHpIga07m3qGf0tXgWtQe5mwocZhVTLL9OjTooW9PZkxM9V7n+XPw3PTo05i/QrgTWEGjDWWR5TyfXRNo4dc02d5GE2CpKRZtJY66B2MGFDTBmgl0ur1MFX1VyiU8zNhcCPb/dTatLCqmfKojIqDl0aOoSdjGLlbLvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qTRPnvwLd7T4i4bIc4d37Y/ZiU5xEXXJs/iJnhDpsMg=; b=Y5bqhRNreSqRsyuxwzaavIs7R5un6eowDMoWu6MPjdyqldZOFAb8/K82gYQJN7DZETRsB2qK1IwBLIMHsJL5UoYp0EuHMGKf1Oz06two1LMN/dqDPH/qr8dX66alM04I54ad7yfXd9zeWg1YpT0SzPWwpia875MjGY+SsiMYDyTrqgbU36RXPsT/OXDS5C+WpzftSmc7DXl6NtFCjSpV5mMOeX6E1qFb+udmjmJskX5eohGKHNIoKh8Pntg9yiAbxhd34m6IZ3mgPWpfT47UygvB/0zjO1UncUCSNIOMc2Kif2oSEQ2dLGyCgphKvCDnKieAfbLbghjRxc0XFRIDkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Received: from DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) by MW3PR11MB4683.namprd11.prod.outlook.com (2603:10b6:303:5c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5186.14; Mon, 2 May 2022 11:39:20 +0000 Received: from DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::806f:3f7a:c1be:ff34]) by DM4PR11MB5327.namprd11.prod.outlook.com ([fe80::806f:3f7a:c1be:ff34%7]) with mapi id 15.20.5186.028; Mon, 2 May 2022 11:39:20 +0000 From: Ovidiu Panait <ovidiu.panait@windriver.com> To: stable@vger.kernel.org Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, Dan Carpenter <dan.carpenter@oracle.com>, Hillf Danton <hdanton@sina.com>, syzbot+0dc4444774d419e916c8@syzkaller.appspotmail.com, Emil Velikov <emil.velikov@collabora.com>, Sean Paul <seanpaul@chromium.org>, Chris Wilson <chris@chris-wilson.co.uk>, Eric Anholt <eric@anholt.net>, Sam Ravnborg <sam@ravnborg.org>, Rob Clark <robdclark@chromium.org>, Daniel Vetter <daniel.vetter@intel.com>, Ovidiu Panait <ovidiu.panait@windriver.com> Subject: [PATCH 4.19 1/1] drm/vgem: Close use-after-free race in vgem_gem_create Date: Mon, 2 May 2022 14:38:57 +0300 Message-Id: <20220502113857.2126299-1-ovidiu.panait@windriver.com> X-Mailer: git-send-email 2.36.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR03CA0068.eurprd03.prod.outlook.com (2603:10a6:803:50::39) To DM4PR11MB5327.namprd11.prod.outlook.com (2603:10b6:5:392::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ad413c0-2e53-4be1-46d8-08da2c30653e X-MS-TrafficTypeDiagnostic: MW3PR11MB4683:EE_ X-Microsoft-Antispam-PRVS: <MW3PR11MB468339A3BA12B9BC941F07B2FEC19@MW3PR11MB4683.namprd11.prod.outlook.com> X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DxXQe3va9ZJtErIfnvATlPcTmwK5eIINaEv5dogYdcc1/7vfukCLxeBnDYUOB/202B9Bskf5pYsti2bEYtw+goxETJqTE2KLbqTpqmzOZg0CRZES2Jj5ecZ7OsMyorc81VAKnBPVW9oq99svfhXJWqIuYoFwsusq9zXBwBN5uj2uWf3zXLsn/v0z402/Ni50bPsek6ecnEZG4wNxT4FLu48ZEiDkKQ+iv/gvRQv6mMsun0Kyz/L38+LBactjIWqVnhV7SHnsNt7anDA4Obpbx5ozDPhQWuGI50lsZNFnv0EAg9eJK3Kg84psHRPXB5OLQk/8QGYwMfT/uwWG7AfROjNhIiwwhjM817DlsSZJCxElWg2W5daG/cv3/UPxgaXBeaM6L5Lf5N3ARf/fT97dKFzPFSCiFz+Dpp3IVqaHrCucw/pM2f7HoMRcsE2ZHZdo3isjE4hdVvExxvZvwJIhPIFaJnPm7C4EGNB+tVo0ArTrOtLEuOmxufx2RBXvF7ke+lBWAM1GSa4ZsXUP80Xw2T/kD9FFsNp6hjeAc9+IEgwuUxuSSzZ4UhOhaspUIipySjC3aEi4bt6lCdUpOOmck0MnMDEH5tBr+NGVsL+5nHwfGEx0y/7awN+0xoUkO0oe6AlbBOnGjDHW8K4QkG5v03p+Fe1cCCTwAiQ30vonk4kiMFSnxRgM2cu3cOG+hY62STkOeoElhqpphFN6zJl4Qrdj4Rge582aVLBsOsrR46ROSV7kuiEi0rRlsXPZETqCMVd/eCmPgFh6QOC/Ped3PXJc7m+mnwqk8NwpH/Wrby4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR11MB5327.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(6666004)(966005)(6486002)(86362001)(52116002)(6512007)(6506007)(2906002)(508600001)(26005)(44832011)(7416002)(8936002)(5660300002)(186003)(2616005)(38100700002)(38350700002)(83380400001)(1076003)(107886003)(316002)(36756003)(6916009)(66476007)(66556008)(54906003)(66946007)(4326008)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FnLIoTX6G0OBjucUp4v4nY9lWO9IpOcJd0Ia8MWDxJ2I1G/63h8WZmlB7QmwC/+tQY6f918vX2yQ82FaUMovwpij7YtrwBIP5LrtDTMwJoFbml74amcPTxRo+EgvSD/0oKjUUqtWrseBfGQ5r3zVCMbMJoY14KeUWPSqcltZCaBGdJpEpVNsEPFfQ6Rypt+t+7Q1jpTMAegvt536qbBzVw1vfltY2+yfaUhtCXoDOPfaIZvxMtCEIk6RPEms7CxhQYWIrdZIcrdSYtPNmB+d7Hx1S3KpfZHnclIAAE5uNMeUiPUwUbCQm3UtJZJYkoJmL5VY4AwlpKHujw/2Y28MGAsVCsSx+SuagMc79A3Mr7vq8g2QTSv7B1EiNV9uFgFhYYDhFI0vK9poFI2yiVXs278pL+0wTWkrQ9iTDrp0RH1wMn2zdKh2w9LSWzi+4udrDmH52jVt5lCEAvigeZYX2JoDmp/Sdd049AMtUFziLCZC8GJcAGDqeCoh9MgTDIGOGKSRiiDkafgMyUIlMJg7KjZ+6A4j7Q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Bbih82bVNByqYY/kVWRvKgeQPNuAUdUfuYOVyspP0K9KWluqufGB+fKe9ZolspoRMLmzcfxFJZYzmsBHDZ75Dy9dCfKXdAhIssM5a3VQ5Pwk/zOlOU3hYOKW+GPzjl0NqxZFqC4mwbT/vEBWKjixguxNbgHt+xU= X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8ad413c0-2e53-4be1-46d8-08da2c30653e X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5327.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2022 11:39:20.5147 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mTBtqjwOX4V1/amThCd1xcQENBMLPXAtibnd7vlpmLV08O3IoCK+evhyBCcmj6IDOTnxJ042XLO1HS2lnI4RrQHB6+ZDICupA2OPSijZtvg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR11MB4683 X-Proofpoint-GUID: p-o3_RGEZQfq0ogdGCrrKQ51qNBZfP1r X-Proofpoint-ORIG-GUID: p-o3_RGEZQfq0ogdGCrrKQ51qNBZfP1r X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-02_03,2022-05-02_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 adultscore=0 clxscore=1011 mlxscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205020091 Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
[4.19,1/1] drm/vgem: Close use-after-free race in vgem_gem_create
|
expand
|
diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index 1c1a435d354b..56ed771032c2 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -189,9 +189,10 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev, return ERR_CAST(obj); ret = drm_gem_handle_create(file, &obj->base, handle); - drm_gem_object_put_unlocked(&obj->base); - if (ret) + if (ret) { + drm_gem_object_put_unlocked(&obj->base); return ERR_PTR(ret); + } return &obj->base; } @@ -214,7 +215,9 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev, args->size = gem_object->size; args->pitch = pitch; - DRM_DEBUG_DRIVER("Created object of size %lld\n", size); + drm_gem_object_put_unlocked(gem_object); + + DRM_DEBUG_DRIVER("Created object of size %llu\n", args->size); return 0; }