Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp225756rwl; Wed, 9 Aug 2023 13:36:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGKA3AVBi3nINq1dZwTfCD6kK3b/7eubeT7CodT39OIXT7IrIit1wi5mhysZ1TCQmS/3A9V X-Received: by 2002:a05:6a21:612:b0:137:3eba:b7fb with SMTP id ll18-20020a056a21061200b001373ebab7fbmr314570pzb.2.1691613403698; Wed, 09 Aug 2023 13:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691613403; cv=none; d=google.com; s=arc-20160816; b=BC0F7PqpWIJlcmWwpAZmDdYggzejp9yUz5VaOBk5MPWFsn53wxNewjuO1jHCJMeQK3 T19+03a5xsxnOZexgM2UVHdagYiogx4SFtoST7wRO8HSbZMHYTC1DA3TEzJhHFo0odKz Ve7RI8MRjYDFXW8ZpkFOfh4taEx0HrTJzJfnXqskBjNiSXX6U3Se2dDuBAhY/s3vS6J6 bvm9et2gSbIj8qBRFS8EZJhHKJimfgOWnqY6kisibNIF5HLdNoWi6mDqZdSYW8sPpe55 jtjsKvITMTgMleiVU21YxEEpxrmvALJSG1PnQfbE9hQ3tlcJD4AFy/nCh/Hl1xzIA9aq ugdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FM8uG86RClQlTl2IJIsSwyAwp4fQSw9zCLfKLqDpW3g=; fh=2u86UswyZm6Kt7hgTSGDfCcYhr5NsxIN7ZtnExUEhXw=; b=rJG356oOjsmHD1yl4K9zcPtld9NkLf2rpYiN/wWIwvLS2UrBNlod3KQY64JK27GQh9 pWpFSE55gQ6nJDg0tZ57jc1spUURDHY7+C9q0y/prrWcMX7bctaznpchOY2p7pta+RPk cuyByDr+5ok9HwCTvsvU/xASDnGpkNXAvqkX/lsZ+Lu3IePnN1RnASwJRYnHcpRPKbPN iq3SoaHmEa2py5D14Rftudn9WznufQ/PpZZVHNudxFQ/edVLWatDg6CqOFDVXRg8MAF2 KKvkSoHrfiNXhaD+EEIJbEfuStTSPJ8YwEPaXNhXfpio2qo0e/IV47TX1jqXGw4Dvc4c BvQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=S7E99dZo; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-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 j64-20020a638b43000000b0055c1fb5a4a9si19309pge.661.2023.08.09.13.36.17; Wed, 09 Aug 2023 13:36:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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=20221208 header.b=S7E99dZo; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S232388AbjHIU17 (ORCPT + 99 others); Wed, 9 Aug 2023 16:27:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229632AbjHIU16 (ORCPT ); Wed, 9 Aug 2023 16:27:58 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01B381FF7 for ; Wed, 9 Aug 2023 13:27:58 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b9f48b6796so3318591fa.3 for ; Wed, 09 Aug 2023 13:27:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691612876; x=1692217676; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FM8uG86RClQlTl2IJIsSwyAwp4fQSw9zCLfKLqDpW3g=; b=S7E99dZouiS4HBtMUx8RHHjzC7hdL36rkDOrCJp3Wlv3dQwV1EAampHTbMAdq1xgRI +MuqO2PXh+lgX7+Q/UR8Kl4PvohLa1c9UbD5bChjQeuYNJF+9CTR/k6wLhAaePe2pguB z8KpYV+pDifPQVqNiKEjyze1bKTTwOCI6Kbi9TV5lhpIKlieF3wIHarkb25l+xhSW8bx /NvkLGCh+W38SHMLg8Pt8gz/+m4A/CsX7lapkbyjWPyaY3z9pcKBg9Tu6nXIdk9VEFL+ zL7PYqryFfnRy4e/EFbnVi+aIJ5CH7fVibRJF+9mtU38Zz2UGqekkhhfMFMOQUCExpp2 +p2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691612876; x=1692217676; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FM8uG86RClQlTl2IJIsSwyAwp4fQSw9zCLfKLqDpW3g=; b=Pd32tn7b6dNOQfCbzVfKpwevOtswTlpHEwW8gU1k9G0jfXlAAWTVSzIDgUTXuOgUOV EKIKBq2sgxLj6G+H+MnCBuPeGEFi6OBnarzfVXQG+xRdN+8mHC3nuW2ESUCls/CcyvoT ikgAiJTik8TwvQPJwehD6yM4geEDYG1ResrbsAkiZ6WLlPbucFphuA+fsWi/ONMCjXrM uVETKN+vu6AQ4TPUBcIhqrDMCOY4y5hwCqkpfolf4AGbx0XSFCku6edkSwivL0qKP1/C 8TiwaI7a53i01SZWLAgtN/gLyvmTEl/mdRO5t689eLqiewB3bXo1VPMxjZuqQXacZSs/ 9dGQ== X-Gm-Message-State: AOJu0Yxplc/VKTPQG6KwuWZfvvHUXVvHFje9HqMrEJ+Ggw/0SS3ijE6h udFUAuKlAYE3BTsXH5JjrSP90C6IoHk= X-Received: by 2002:a2e:7806:0:b0:2b9:48f1:b195 with SMTP id t6-20020a2e7806000000b002b948f1b195mr196802ljc.44.1691612875499; Wed, 09 Aug 2023 13:27:55 -0700 (PDT) Received: from localhost.localdomain (77-169-139-185.fixed.kpn.net. [77.169.139.185]) by smtp.gmail.com with ESMTPSA id h15-20020a1709066d8f00b00997e52cb30bsm8350819ejt.121.2023.08.09.13.27.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Aug 2023 13:27:54 -0700 (PDT) From: Bart Philips X-Google-Original-From: Bart Philips To: linux-bluetooth@vger.kernel.org Cc: Bart Philips Subject: [PATCH BlueZ 0/1] fix writes to attributes of size 512 Date: Wed, 9 Aug 2023 22:27:22 +0200 Message-Id: <20230809202724.15429-1-bart.philips@inspiro.nl> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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-bluetooth@vger.kernel.org writing attributes of length 512 fails, although the Bluetooth spec (Vol 4, Part F, 3.2.9) states that attributes sizes up to 512 are allowed. The check_length calls in write_cb and prep_write_cb in gatt-server.c currently pass the length parameter that include the handle/offset length and therefore fail for attributes of length 512. This patch subtracts the handle/offset length before passing it to the check_length function, allowing writes to attributes up to 512 in size. Bart Philips (1): fix writing attributes of length 512 src/shared/gatt-server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.34.1