Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4070358pxb; Mon, 4 Oct 2021 16:45:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyILO4mNERoIVB5tPC/QTjK3Msm+7gU/dyEKrlpQ5Zhqvk+c9ggx+KMzfA7rJ8xZmWVepu1 X-Received: by 2002:a65:5a8e:: with SMTP id c14mr13302113pgt.125.1633391128330; Mon, 04 Oct 2021 16:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633391128; cv=none; d=google.com; s=arc-20160816; b=aAOSm28dlnyBSME8Xemw/I3ArorGe0f8tck1oaS8g2FlsFJrT9mvLJuGiZKLvVIZ/c 9ciS3xk/IXgDScpys02X8yLs58hTLav+K+45x3XYpEiZW4O5eH3UTjp6/7DBaLT+cabb vxH0A3/B5dj85S/7zhZEvXDQKhZL4M9YHKdfY0syH/tz0OvVa378HxcZJMVyyILfXIaN N2BYosI4KNdGOylulj88ycyhtgw4aT5JWvPlZzwljUTmbETJBRlf3ulo+ZXEXX8O9q7V d46U3u+HRJM3/6yCaeAzaFOjsZIfjMNmO/SK9sPyGcSlDxLA7/93EYTpTgvqiPKGgbJn 744g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=c0hwqs6p7Ru2CkxdNWAgix4idc1xYEonvtNVJOMJao0=; b=z/DTxtkLxWAYhjhrL3HhHqAiBs0DXeo7+F0CHPDPRmyJYh9yj7bFzMVg+gEqtRZCqh TRykLVHRkQB4Mz+yHZFiwukZtqWdaL4icdGvc+zofkx1U3rAbxmHAQsQVbAqcA8SrnIT Hd4gAyDytyFL4OKd1HF2saIVjQ1zSZEa88s4SlAfDsWaHKAdUwTHw2n4gVn6SaY1L9Kd emh89xIfcNSon3QZ4v81tKkSzNGPgQDtMUvVJT9446UmqiWePXC+HFmhh+FwPqM+QtXA 247uVqcWby02pcFtn4Ehh/gZ9kPo9qMKustG+4IYyCcSoceNZ7ej2VmYzrQX7ut8Bwrv 6rtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=ROnqbH3A; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si30117520pgu.423.2021.10.04.16.45.15; Mon, 04 Oct 2021 16:45: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=@linuxfoundation.org header.s=google header.b=ROnqbH3A; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236367AbhJDUgm (ORCPT + 99 others); Mon, 4 Oct 2021 16:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235526AbhJDUgl (ORCPT ); Mon, 4 Oct 2021 16:36:41 -0400 Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E678C061749 for ; Mon, 4 Oct 2021 13:34:52 -0700 (PDT) Received: by mail-io1-xd32.google.com with SMTP id 5so9315445iov.9 for ; Mon, 04 Oct 2021 13:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=c0hwqs6p7Ru2CkxdNWAgix4idc1xYEonvtNVJOMJao0=; b=ROnqbH3ApfRdwm045GfASwtFIN3fGzOP1qpYXoFJg5LT+LODJlJbWho8fNVopL+bCY ONCasCj5CZNAQ3EU7x+6O5rVy/UMzIsPhB/EATs1fmaoX/vvhX7OKkG0RNqiEsXTM5+m S60uDyWm51GQX8xSA14uOeK3U8W0tnxuHejic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c0hwqs6p7Ru2CkxdNWAgix4idc1xYEonvtNVJOMJao0=; b=SYGYV7mmtVWzvGtkn0AMNGr+ZOwv/M/TGABeo5kGWtDGN7My0VBL9XJV//wQpDUFcV l2G/tL9wrckqYcnAQVtUx1A/2V62aoLKyDY3+DPo0dvjdGEL0J58odkk4db1y6ZdbiHO Gum/Q2owMWORQYqM5i1sTLbcIE5RdNMStSvUH3SwmVL7tYJiqyT4EzsFI2RRlZmLt2NA mZiTQGVTPQ+xlyaFffrjdXM9cZrFBfpmF9FPDu9Jxj0a+D5Sbe9/Zwb7L9I9xGDP7THw erCXS4zzNEOaNfn49OcBHgXsPFxz8yT5QUq7Cl0DcrYvfszUMdKjdhHhmjeFLRM063to iHkg== X-Gm-Message-State: AOAM533nDgrA/1jA8FkbKvsZLN0PewzwULmcqHb16mK9bFBk8/OLBEIP 3I5oznZsarytlWIbt6kmF/xAsA== X-Received: by 2002:a02:caac:: with SMTP id e12mr12873268jap.16.1633379691949; Mon, 04 Oct 2021 13:34:51 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id l3sm9697379ilq.48.2021.10.04.13.34.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 Oct 2021 13:34:51 -0700 (PDT) Subject: Re: [PATCH 4.19 00/95] 4.19.209-rc1 review To: Eric Dumazet , Naresh Kamboju Cc: Greg Kroah-Hartman , open list , Shuah Khan , Florian Fainelli , patches@kernelci.org, lkft-triage@lists.linaro.org, Jon Hunter , linux-stable , Pavel Machek , Andrew Morton , Linus Torvalds , Guenter Roeck , Netdev , Jann Horn , "Eric W. Biederman" , Luiz Augusto von Dentz , Marcel Holtmann , "David S. Miller" , Shuah Khan References: <20211004125033.572932188@linuxfoundation.org> <576d46b9-644f-ece0-2cf0-8abbe8b85f4a@linuxfoundation.org> From: Shuah Khan Message-ID: <14314f54-57fa-fa89-ce4c-ce79116d3d80@linuxfoundation.org> Date: Mon, 4 Oct 2021 14:34:50 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <576d46b9-644f-ece0-2cf0-8abbe8b85f4a@linuxfoundation.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/4/21 1:49 PM, Shuah Khan wrote: > On 10/4/21 11:44 AM, Eric Dumazet wrote: >> On Mon, Oct 4, 2021 at 10:40 AM Naresh Kamboju >> wrote: >>> >>> On Mon, 4 Oct 2021 at 18:32, Greg Kroah-Hartman >>> wrote: >>>> >>>> This is the start of the stable review cycle for the 4.19.209 release. >>>> There are 95 patches in this series, all will be posted as a response >>>> to this one.  If anyone has any issues with these being applied, please >>>> let me know. >>>> >>>> Responses should be made by Wed, 06 Oct 2021 12:50:17 +0000. >>>> Anything received after that time might be too late. >>>> >>>> The whole patch series can be found in one patch at: >>>>          https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.209-rc1.gz >>>> or in the git tree and branch at: >>>>          git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y >>>> and the diffstat can be found below. >>>> >>>> thanks, >>>> >>>> greg k-h >>> >>> Regression found on arm, arm64, i386 and x86. >>> following kernel crash reported on stable-rc linux-4.19.y. >>> >> >> Stable teams should backport cred: allow get_cred() and put_cred() to >> be given NULL. >> >> f06bc03339ad4c1baa964a5f0606247ac1c3c50b >> >> Or they should have tweaked my patch before backporting it. >> > Seeing the same problem on my test system as well. > > Patch applied with fuzz. Didn't need any tweaks. Compiling now. > Will let you know soon. > With f06bc03339ad4c1baa964a5f0606247ac1c3c50b Compiled and booted on my test system. No dmesg regressions. Tested-by: Shuah Khan ----------------------------------------------------------------------- diff --git a/include/linux/cred.h b/include/linux/cred.h index 1dc351d8548b..4b081e4911c8 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h @@ -240,7 +240,7 @@ static inline struct cred *get_new_cred(struct cred *cred) * @cred: The credentials to reference * * Get a reference on the specified set of credentials. The caller must - * release the reference. + * release the reference. If %NULL is passed, it is returned with no action. * * This is used to deal with a committed set of credentials. Although the * pointer is const, this will temporarily discard the const and increment the @@ -251,6 +251,8 @@ static inline struct cred *get_new_cred(struct cred *cred) static inline const struct cred *get_cred(const struct cred *cred) { struct cred *nonconst_cred = (struct cred *) cred; + if (!cred) + return cred; validate_creds(cred); nonconst_cred->non_rcu = 0; return get_new_cred(nonconst_cred); @@ -261,7 +263,7 @@ static inline const struct cred *get_cred(const struct cred *cred) * @cred: The credentials to release * * Release a reference to a set of credentials, deleting them when the last ref - * is released. + * is released. If %NULL is passed, nothing is done. * * This takes a const pointer to a set of credentials because the credentials * on task_struct are attached by const pointers to prevent accidental @@ -271,9 +273,11 @@ static inline void put_cred(const struct cred *_cred) { struct cred *cred = (struct cred *) _cred; - validate_creds(cred); - if (atomic_dec_and_test(&(cred)->usage)) - __put_cred(cred); + if (cred) { + validate_creds(cred); + if (atomic_dec_and_test(&(cred)->usage)) + __put_cred(cred); + } } /** ----------------------------------------------------------------------- thanks, -- Shuah