Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1107600pxf; Thu, 18 Mar 2021 21:45:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUmY3Xtw3ueKqTLIbZXp2vrhu4QQTw3NRwCc1IDKZkV7081HY7VXkMVop4xwwqSzL78dLO X-Received: by 2002:a17:906:13c4:: with SMTP id g4mr2240208ejc.390.1616129125251; Thu, 18 Mar 2021 21:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616129125; cv=none; d=google.com; s=arc-20160816; b=BBi0aTG3AfsAFXWz7NjKlyhdKGXN+xOrsYzxFgT9NpX3ehoc2AVm1XFnWzYxWI3rbT QfMTb/vOgbna8sEGYnDte+mSfWc4xi6Jcvo+SGPB9xFAIZPqal2QN3kvFUPaE4MTQYJJ vG/Hkw96MRQrum4oDyZ9PmGuLGPfPnSFZJOBuydBRHVOFkuheFeWEsTJUGqJHaM8FIz1 pvMxkYwqqS94PGEVNywXuhuUP5J3/bTPfS9aQNanQ0f2wfuWSzWRvq7YF8OQj6T+KPSO olIHtVwQ7a+mj1iL5IFEmePK4EEuIPerk1IIxICQq3sRcQV1jk06buBi4/L+id/+h0yN Kk+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/fv8yF6cLog/DqO+5rcgAQEuQpvcChxvz0nfrBhbweI=; b=pGwB7dNrrDentKJ7DOcnEW/Pku+2dorsLYZINvXhIGAqyGXbLzOnXSR+oL0znKGkDd A4bifEdkSEWVVJqtrm8XSGTGi/AbNXyJafZYhYwRmqRG5f8R2eLWbdYz/QCXhjsdbyVN KX2i9uXC4dMN/c+02/YLRiVGXjed+Y9Mpzsve9gCEfMH5xo5/0oIx70Z5mz13Pe4q0m5 SAN0y27XhD1BP/p+ZNQsBQZoZYM55C06LlO1Bej8+Vkdro/jhChdEI3jo6g9qBJgaEmg UhmZWXff4zUUEWuSMScwKSNkEpVWZ4ViYeHq1U7H3H7hQsA5O/Hn7QSS36XLxMA0nu/w xoLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FjLloEkf; 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 y22si3212093edc.181.2021.03.18.21.45.02; Thu, 18 Mar 2021 21:45:25 -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=FjLloEkf; 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 S229447AbhCSEnB (ORCPT + 99 others); Fri, 19 Mar 2021 00:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbhCSEm7 (ORCPT ); Fri, 19 Mar 2021 00:42:59 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58563C06174A; Thu, 18 Mar 2021 21:42:59 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id v23so2369449ple.9; Thu, 18 Mar 2021 21:42:59 -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=/fv8yF6cLog/DqO+5rcgAQEuQpvcChxvz0nfrBhbweI=; b=FjLloEkf36ItNVHL0teWzRJlzjtyV1nV+Q5MKt36JyTmEZDgCq8NbddCpDHsnRrDNI J9oPhEvptumDsd33wilZmayeEEm9cr2UrRgaLg5Q3bvtpRGaUL6CsMehnPWVh0fnOfx8 PqbZYnfKk8QgnPieofJRWEZP73Vhp7MnUAvhrUq/Ay1ynGBZZscIInkZR3rpgUbTKtwc jzTJlL0bmsiNRpedLVXLYpvDHymtDaRayS7uZe6dZVCPP3sueObV3mW1REohwOGtcIRm yHTmvTP1j8mlNF+5S2FaYuYB87+l2FJ0s1fJRM1Tn4VCegzNh1fC4d2xii46LnFdQyp6 5/yw== 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=/fv8yF6cLog/DqO+5rcgAQEuQpvcChxvz0nfrBhbweI=; b=Ynk3ZdgYa/1EpMaNaPio7uVFuGn3Li4dWHCbUHnJjHwG5Ow5TXX/MWJ1uUSvb2+yAS QaPRF2Dpo+diKPJPJDqYpb1WnT5OGAinQaY6HVariowsPmXY8sc77MbTQRY+rQoqk8OB ptmIU8P4KPiAt4N/AaqFRxtDfp0bEsFpWQ2Bzp+caTxuO+3YMKs23mGYRgHEtpGIm+jW 7GNQD/CAL5PdjRt+EEPEKhfuNEdqzNRBnoBoE4D5Loz/SwFV01DQ9PfUPDyOEiQe7oEF CMI8sbeWd7dX7lu2du3gRBAP1XnyUJ4ruHHhhrp8B8q/DR7WP0icf26dCBJdUnRLI2rG iKXQ== X-Gm-Message-State: AOAM533mERoP/tCeg/ZhBp07lqGpqKZVeGrT/BynX4mUCSJYawQo1ufr VVXPooWiqKDFTMXMGpRX+Xk= X-Received: by 2002:a17:90a:8408:: with SMTP id j8mr7866985pjn.1.1616128978740; Thu, 18 Mar 2021 21:42:58 -0700 (PDT) Received: from jagdpanzerIV.localdomain ([2409:10:2e40:5100:6e29:95ff:fe2d:8f34]) by smtp.gmail.com with ESMTPSA id i20sm3402071pgg.65.2021.03.18.21.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Mar 2021 21:42:57 -0700 (PDT) Date: Fri, 19 Mar 2021 13:42:52 +0900 From: Sergey Senozhatsky To: Dan Carpenter Cc: Namjae Jeon , Hyunchul Lee , Steve French , Sergey Senozhatsky , Ronnie Sahlberg , linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] cifsd: Fix a use after free on error path Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (21/03/18 16:12), Dan Carpenter wrote: > The ksmbd_free_work_struct() frees "work" so we need to swap the order > of these two function calls to avoid a use after free. > > Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") > Signed-off-by: Dan Carpenter Thanks. Reviewed-by: Sergey Senozhatsky -ss