Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1070894lqe; Sun, 7 Apr 2024 18:12:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVmYY5ioUOyx4EGzULNX65MO+wiCeQpTpS4/AVm/LRuClz6OMM/Ym62j6dqN7OLiwZsAT8w+ekydX9wUPkaqFtL4A8pGyRCe3276dlnBw== X-Google-Smtp-Source: AGHT+IGeT2TUKseCG3zcW90E0ktk7ovjGEEQGlJLT+BGIPCAz/o5CHZYWHw+B2Unj7y8pZAz0x4r X-Received: by 2002:a17:90b:387:b0:2a0:86b6:2e9 with SMTP id ga7-20020a17090b038700b002a086b602e9mr6336762pjb.12.1712538732060; Sun, 07 Apr 2024 18:12:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712538732; cv=pass; d=google.com; s=arc-20160816; b=WjBPuJPRlKDTUb7jDfe0lDo4m8bPR6JdEfd3CWTpxjcqaBnIFTEAVVoGAR07wWgxw4 qFpIv3J0j7C2anguy1lpMYU3Vo5ED6I+7Mn9ezsvqxwDaKWNEbDFVpmeOXX/eVuQgowj ES8xbVm2lUcKe2H93UOL/yaXn1Sxc5AxrNi9F0qP05nRRcdniA7YLZYbLhaVGEOvntF4 Zz1wnB36rNTiFH2De5qMwkGTiMVMAYi7iqGN1lAVpzTlROozKWiuDz44I4OwQVwhDo2n jP5zJf4O9Zu600YTMfONPQJlOwddrYm0zfURlUFgKqNJusClzi5FFZTJkowD0q3bfPRJ iEJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=uF5BElzCvAdpkLJb2QXveN5toia8fJ2bizYAdEXmMrA=; fh=k2JNbgunjXkH1uUhtjZrgo5mvq+IW/r42h6SVG4mKOo=; b=H2rxWouYYZVbVa3v3mz8hg78wGDTBM6PdcX95/u1sEFhFhX53Di1ckuMt/FL90DzZz D/j8nvjbhyBT8mX2cfUFeu7ocB0XTaRjFXR0qd+FAkpiV9ct1sCIw6ef0C15LxPTYkcQ uBkg+2Db33EDArUwQq0UA0vcL4l8FKImqR0JW+Smh7/ytB7WyI8ywKRVflE9FZG9IQe7 DRwtmxeJBZAfNaT8R7vlbgVy44QkdvbsUt7cTakzAoKAUSlqxAfYILvWcsChECnBIW4y UZewJ22unfPu36csgpcA7lOKdA8N7qFmlM9tiLCs0B+w6ubPWD6MbvXD6hvyxcQsJsWr 6/4g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-134691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134691-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ob10-20020a17090b390a00b002a53740c5c2si145394pjb.112.2024.04.07.18.12.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Apr 2024 18:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-134691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134691-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id ED60AB20EF6 for ; Mon, 8 Apr 2024 01:12:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4193F1851; Mon, 8 Apr 2024 01:12:00 +0000 (UTC) Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B15F15C3; Mon, 8 Apr 2024 01:11:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538719; cv=none; b=rRh9sQI+3fRI7lPL2oMaLBRK85QIr5GIhloYkCs5CMQO6vO7rRVTQheWJlxeeo0UxgJJsl0drSxlF8lq5NooVuEo8fGj98gDtTUeRwcZj2juV/nIFh9wFb5v9PCzrzH7HJKY+JpufdhCkL6nEcToY7slOFQWH9iHj4FWwtyJscw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712538719; c=relaxed/simple; bh=4EVxEq7n2NTrxGnlfm5xidYmy7Zs5Hgok4o5LcFBMIU=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=GHrUzWc/NR1/REjXhNju/aPNFlREtbuOju+Eo7WfvZ2GTSSj0RbRoeC7O266AbaOgzYvlkz2cR+gJjir99gjfY5EnXiil1E34kmpoi2nezUWe3w8gaVPjoI05E7WXr8QmLrJ8aNIWjMdTCcdlXwpvLu4DfkVGXkEjt6exyIFRFo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.216]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4VCWJd6VZHz4f3jYS; Mon, 8 Apr 2024 09:11:45 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 9D9A91A0DBC; Mon, 8 Apr 2024 09:11:52 +0800 (CST) Received: from [10.174.176.117] (unknown [10.174.176.117]) by APP2 (Coremail) with SMTP id Syh0CgAnTA9URBNmH29iJg--.3919S2; Mon, 08 Apr 2024 09:11:50 +0800 (CST) Subject: Re: [syzbot] [bpf?] KASAN: stack-out-of-bounds Read in hash To: Alexei Starovoitov Cc: syzbot , bpf , syzkaller-bugs , Network Development , Andrii Nakryiko , Alexei Starovoitov , Daniel Borkmann , Eddy Z , Hao Luo , John Fastabend , KP Singh , Jiri Olsa , Martin KaFai Lau , Stanislav Fomichev , Song Liu , Yonghong Song , LKML References: <000000000000b97fba06156dc57b@google.com> From: Hou Tao Message-ID: Date: Mon, 8 Apr 2024 09:11:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID:Syh0CgAnTA9URBNmH29iJg--.3919S2 X-Coremail-Antispam: 1UD129KBjvJXoW7KrykKw18Jw45Cr1fKr4kWFg_yoW8Wry7pF 4rGFWagF1qyr1Ut3Z7tF1DW3WjvrZ8A347Ga1jqry09a1qqr98Jr4Ig3y5uFWUCr1kAa4S yrn8u3WfA3y0v3DanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvIb4IE77IF4wAFF20E14v26ryj6rWUM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x 0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7Mxk0xIA0c2IE e2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxV Aqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a 6rW5MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6x kF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF0xvEx4A2jsIE 14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf 9x07UZ18PUUUUU= X-CM-SenderInfo: xkrx3t3r6k3tpzhluzxrxghudrp/ Hi, On 4/7/2024 10:24 PM, Alexei Starovoitov wrote: > On Sun, Apr 7, 2024 at 2:09 AM Hou Tao wrote: >> Hi, >> >> On 4/6/2024 9:44 PM, syzbot wrote: >>> Hello, >>> >>> syzbot found the following issue on: >>> >>> HEAD commit: 443574b03387 riscv, bpf: Fix kfunc parameters incompatibil.. >>> git tree: bpf >>> console+strace: https://syzkaller.appspot.com/x/log.txt?x=148ad855180000 >>> kernel config: https://syzkaller.appspot.com/x/.config?x=6fb1be60a193d440 >>> dashboard link: https://syzkaller.appspot.com/bug?extid=9459b5d7fab774cf182f >>> compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40 >>> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13d86795180000 >>> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=143eff76180000 >> According to the reproducer, it passes a big value_size (0xfffffe00) >> when creating bloom filter map. The big value_size bypasses the check in >> check_stack_access_within_bounds(). I think a proper fix needs to add >> these following two checks: >> (1) in check_stack_access_within_bounds() add check for negative >> access_size >> (2) in bloom_map_alloc() limit the max value of bloom_map_alloc(). >> >> Will post a patch to fix the syzbot report. Will also check whether or >> not there are similar problems for other bpf maps. > Isn't it fixed by > https://lore.kernel.org/all/20240327024245.318299-2-andreimatei1@gmail.com/ Yes. Totally missed the patch set. The patch set will fix the syzbot reported problem.