Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3563207rwl; Sun, 9 Apr 2023 19:20:40 -0700 (PDT) X-Google-Smtp-Source: AKy350Z0s4bn6VvCkeXMO1WvIo1XeWjQ66XtPKNm2QrD0cMCb+ygz1x78Xc5/C4GbwGWLStB5oQD X-Received: by 2002:a05:6a20:b291:b0:d9:33a3:e7c5 with SMTP id ei17-20020a056a20b29100b000d933a3e7c5mr5720612pzb.35.1681093239834; Sun, 09 Apr 2023 19:20:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681093239; cv=none; d=google.com; s=arc-20160816; b=iXxo+pORu9JLRqZ8vF9E8f7Yo/QVlyBtdvExuJsXTPOaoIFgUUnp7Ayc7DtZgLriHv 7MV+tUq50NyhGoeCjwv9jWHLVUHBG+SbN2olhzkTTz2V9zeqUPW/5C0q3K4DSZDZbzYA tqNLgtozD337J084VQqz5aPV5rNa3LoKq1pIpxvsinqbHx3e2zra6rGO6WwB0oPmO4mr j9R4y0xV9LTyD3wP0z5h/uKCCFVQSyZVLcuTcfl5EjTGIZl/5iC368Qo/rQfdk0/IgZO +Rc4QLa4818sr6v6oMXfbvWp2HNnO8TLAxtsAyt1TNcmqgcnrNM5bOT0LMcIsDmFBP11 Eesw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Wf+efalkSkI9mDMxtM/0oFO463/s9uRI1g/ofMKtVDo=; b=AT+fkhuBsI/CMxlyftdv1sWk3qEVDQ4sBbCanFE3CcqEyJ8Io8O6NFKgqe5hVNb+wQ SSjJS738K1kBtDmfxZzAATLphuMSoxD6ttTYJro8pIblXkI2gl7cpFbWxhouso53sQHu roZIGQsz1fA7+M6nmm/GdeOE652V5g4nnLkBBSIQIQiDRbziD8Jar/lVO5l8fXF7AfQI U4QqsxXcwXiRq3q1pFlMurJRtgQ8AX5PBkk0KqZ+mUwYCTcvASetm+5/6Hr0KdrBCxtB VCuktpMRk5xqA5Nn+J2Z7D+/+RRtSV0veNcXjIvvpwUVfJUdMI7BSznagj36sWRKO8tB KT7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WUDlFzBq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k66-20020a632445000000b0051aaccf1e13si393621pgk.724.2023.04.09.19.20.27; Sun, 09 Apr 2023 19:20:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=WUDlFzBq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229687AbjDJCRm (ORCPT + 99 others); Sun, 9 Apr 2023 22:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjDJCRl (ORCPT ); Sun, 9 Apr 2023 22:17:41 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80F8D3C21; Sun, 9 Apr 2023 19:17:39 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id bx15so2065827ljb.7; Sun, 09 Apr 2023 19:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681093057; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Wf+efalkSkI9mDMxtM/0oFO463/s9uRI1g/ofMKtVDo=; b=WUDlFzBq4CMSyM65JP/KVwNhuWO/RvSl+oy866bY0BnNNEASFunHZ+hSDxCSEmW8lD E9H63EEimuLNHW8A4CVtaK5W4nINAv27VKeF16TJMA6tT7HEXFgTFRCbdgBFqgS+Wt9T g7kKyK22WkrzO8eC1O0jFEH407JspVuyghQUqbvQ0nVMGvAskJRH9lhCf25LWFFAPmxm lgPF1US1pVdLAl/jNasKmk2pUs8zJKNphtS4QGGk0M+KdOrfspcLzL9H9pAMI93w8ex7 OeODgTFbnPy/q8PsUdTjNP43qzWhEhqE3Pa4Qd+INiYWeh6VnfCLIeMRMlIzeefGtEjE zUIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681093057; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Wf+efalkSkI9mDMxtM/0oFO463/s9uRI1g/ofMKtVDo=; b=7DGvg7jXjcveCK6C89uJGDlvLsxoVoLgZpBh10w0xgzjak9LUrK2o+Qi9HYkl8pFrE KtOsqCUzKcitYOD6RprWkwTDi5t9gas6dTtIelVkeXptPNSnpgeDbGhlXFenOgqkd96T 5PprbTz/X44qIuq9Cwd6Qqd5+Qm7W8zgHYiKmZLvqLpUDIwrMFJ3I3C97NRp+xssifFs 6LDzvV8eecehor5VVpUwHOmYnQ1Ad9H3jurBhsprZc4ULnj9ZsEgXK1OBWPD1xklrjz2 RmKGEOIgFHZOQ/84L2WAX5wBXy8DBJLisbmQVKzwUm4RHqiVU7gqUVfmxRoucWwkETbG TFeQ== X-Gm-Message-State: AAQBX9cGSZDP1Uytf1z99EYgF9rvn72LwwquWUneGRqkS7w6ghE3H9PU ngsnabrj0HMY02OkqzcE2lAk+AaEX9Ud0nz5K0I= X-Received: by 2002:a2e:93c3:0:b0:29b:ebfa:765d with SMTP id p3-20020a2e93c3000000b0029bebfa765dmr2450197ljh.1.1681093057526; Sun, 09 Apr 2023 19:17:37 -0700 (PDT) MIME-Version: 1.0 References: <20230206054326.89323-1-k1rh4.lee@gmail.com> In-Reply-To: From: sangsup lee Date: Mon, 10 Apr 2023 11:17:01 +0900 Message-ID: Subject: Re: [PATCH] fpga: dfl-afu-region: Add overflow checks for region size and offset To: Salvatore Bonaccorso Cc: Xu Yilun , Wu Hao , Tom Rix , Moritz Fischer , linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, In my opinion the code has an insecure code pattern. The size may have integer overflow condition i think. But, I did not do dynamic analysis but I did static audit fpga code(I don't have an fpga device). because of this. I don't make sure about Yilun's comment. I think the code must have defensive coding rules. best regards.