From patchwork Thu Jun 20 08:49:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Van Den Berge X-Patchwork-Id: 1949984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=JnqzGu07; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=HnxhY+fu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::337; helo=mail-wm1-x337.google.com; envelope-from=swupdate+bncbcmixzeahiikhwwpwmdbubbbm24no@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-wm1-x337.google.com (mail-wm1-x337.google.com [IPv6:2a00:1450:4864:20::337]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4Z1N2G3Yz20XW for ; Thu, 20 Jun 2024 18:49:44 +1000 (AEST) Received: by mail-wm1-x337.google.com with SMTP id 5b1f17b1804b1-42476eda16csf6506285e9.2 for ; Thu, 20 Jun 2024 01:49:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718873381; cv=pass; d=google.com; s=arc-20160816; b=t5Djx9pPSnAlWj1sVdLzDBUwTdJCN7q+yFNSFRwWkhnZ9JLloIA3TKdt5rHHn3Aeqz K2UdY5NXq08nmlwszzML9hyUvNW+gfCvkAqkNDpe2T1MpDaJ4S5PXaV3yvx+Nag9apHG /EE3/XAPow+XRW9XvKlS9HIUhQ+hyExJbNxgXO7bcf4wA4b4IfrFWSbMMmgDd+AX9pGm M6Gbo8xQ3p0O4DgM47tXXhdVIprChc5pudj10EnLL6CbbBrqfhT3EocCsZgmA6IRBLQm tO+jIayyawSHYBWW1dLtL5RmYZyDl7+MD975SZ9PE12WbpH82Bu7tjquFJ1V8LkmpNTc RyPw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=KOy6N8LUIHT8ysL4/G2NEJzKdv6/FU8Abfvj9h3e1Ks=; fh=DDfUQMcOWUxe9/oz/u5yx9c/Mbw8DL8FoIUft718XP4=; b=yaUehNKvxrjgBZW96uxfO9D3whqqEuYo5uUB4FRQeJEOicct4FJ/FtLLw32gNXvs39 tY4h3p6uYb9QXZU6meEvr949P7ugbTxNOrFB8YsuOTCMZDapjMAFvrFXtSRnlnoDUNh1 2FgFjA+fCP1j6ByqGmDNxKN6pIfHoDqjZAdf1JbezXVnrJXOq4Vr0QpBbaFd0ykvm0G7 g6mbUGj7Cc1S4M/3dvnxpQCZ/pUKFYiq0ovzsQ4m3D3IOK28xY6lBnVxvXsI90HQNdwv DnK/76GzBRBkauCcX3frne5zfz/NbgIBLGH7V1FNe5qusOEiRZqv9ulNhq7DbZOWsjI5 Nh3A==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LeNT8aOI; spf=pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::62a as permitted sender) smtp.mailfrom=sam.van.den.berge@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1718873381; x=1719478181; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=KOy6N8LUIHT8ysL4/G2NEJzKdv6/FU8Abfvj9h3e1Ks=; b=JnqzGu07fv8v1yJP6k4iKGudrsJSfmFBzMj7u+vtYP0gjUKNXM0FDK46Chyb4sOBZL 9HUnYluz7Ay8gk0RtoaOp2uNLJfp3Z/GkmdAaLibcUShguy4kguwKt/JNQhSOf1soVH0 PaUERjg//+nc6ItN9bCR5iwEHmo1T7CLsUi2DbNCekEbhIQrWheovXjHVXbUNjrUuohm /X3yqGj8iWBoGgURv6UITrVg33SvAboj8/bZ1ZPrE87UgWqFrg9Q9Ch4yzApwTpHQgpY TIVx34R+vNNRlFnF3rmDweW91uvuzpPio90pugrxbithkPL1IIKL3AMwkRAvoVA+qTmL wTYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718873381; x=1719478181; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=KOy6N8LUIHT8ysL4/G2NEJzKdv6/FU8Abfvj9h3e1Ks=; b=HnxhY+funDbIohf6Dh78NVA56zGYFrtbSoieL6XIod2Oo/FOZI0uOTV8XDD/Q8GOM7 P/1xIXp9m3BMY92JIT/+DZjh5HjeBwG/gZLVV5RLoQfn9Iqg5/sr/YL7PrgzmEJHdfkl waKJd1wfktlmEL4R7GyRWPagBWBObGKlninFEhPkvsg++0KbzKUlzhOAAbqhmbPzVm3s wgfMMnRAEMBupuaOZH5ZKa/LKZo8m55Q6UCqgdNSINgXq4P/dkZ5r3K8yr8eoLVvaLdj Lwz2u3WApDltipzHFT1uArrW9jJhQar3wh/8OX48dJTNwsGlZb6eVxkuCCGp0ICtqMeK 5khw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718873381; x=1719478181; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=KOy6N8LUIHT8ysL4/G2NEJzKdv6/FU8Abfvj9h3e1Ks=; b=A5EydAwwcMlW2tlIRzG22Jd68ygfHwVYU5+S0F89c3S6clZHF+COFxTo6Q9N7TXfal DJU/hegEqH7PimW/gAs84b55W2VxymIVN0YFqaKlHD6FjtGjy0XcGvlRqAyk9Le4Ah8V UvdSy3MvJxZKwaG2H1JRnridsqQKFvGU5suAngJNVbZ8JDKfpSCIxzLXCaCBBADV5iCP SSfb8gmY5uQZZyYtHpOemNYGe/abyl2AxVdRCQE6bT4yPhp4AwEdKqXI2wkIS9iiR4iP bMWlfgEpWKUdw4aCvqhhlljLBYer0DUuPNR68NQEQr3avRB7Nx0M3PcecNcwNfeROUFt Z+MA== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVE7jOGEOtAdkuTq8QEX4VRIa8tIHZ0xEOo4x1AvaBtq9nanjLZO80J6ucVQepbveXh0jnC6HHIQAsBI4ZXI9m8lWzJ7VBLp8Bnv4PBPg== X-Gm-Message-State: AOJu0YyZ869n8ZN80Zhpauit5digTou9HpRz/GjPfUknHu8tMrj+oSc9 b7kRJnSi0E61ELIndp2nkrphbfejBPpeUa2IHGGnMARy2xQosJ1W X-Google-Smtp-Source: AGHT+IHvU893NcY32wylZocfnk/GeddtR2yKNGLkoqlfZNaA6ElhIplp2gOWt9RRGWwYiu4im7M9RA== X-Received: by 2002:a05:6000:104:b0:35f:ece:3f63 with SMTP id ffacd0b85a97d-363192d007fmr3462737f8f.46.1718873380619; Thu, 20 Jun 2024 01:49:40 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:600c:1c86:b0:421:7e41:1878 with SMTP id 5b1f17b1804b1-4247bfa8ac0ls3526755e9.0.-pod-prod-07-eu; Thu, 20 Jun 2024 01:49:38 -0700 (PDT) X-Received: by 2002:a05:600c:55c4:b0:424:781a:188b with SMTP id 5b1f17b1804b1-424781a1a4fmr27239615e9.31.1718873377934; Thu, 20 Jun 2024 01:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718873377; cv=none; d=google.com; s=arc-20160816; b=NysfyntXwQYupO7ZkZvtYT1brol2o3OZ2IR6nbzpcjD5fSCTyP8rBKrxmALI9Ebsfe 5m7XNjOBWyqZHyFaWXDFOZf55IYz1YPEC3dprG/+p3TwDSmxmKUz7UlcmNtfyF4VlO5D hpw6ym4VoKFl8dYkWbpvAmxIHufNKvxteF1YeugE04ymryjLt9PywlbNFkiU5vI20rke r45EBI78Hxi97gBWa93OAME1CdK9FzBrD+cl3PrR8lqRw9n/LfluEQG79yYUo6e2w4G6 JQFtUuC3qJUBCARpI5BSNFZ7KUZ4vYRl42+mxos9gmJ2gOZCvTom20xCu1xs7A13sMiy V/ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=OI1QJqN+EcQPv1vskVy2J+WYuoiH8+MbnEtsMLuhYgE=; fh=zPj9XISeXCrbHSE2NBddncS14JRDUgXVZH7cnyOa3LQ=; b=nfOXOajLKGQUM8ST90vDx5apjO/zjrabJ3+SGcl44QvAmvULfYxNRqnAGifyte9hir Bgt+9NIzoYGSeYdgjYV7+9fT71I2b6ghLOsW8Dhwrkv1zfHZBilcTHRRthhib5Ncj1D4 ETVXAHKc6jlr0Cm81P5jmzUd2ZCeFc7MYbxIzb//3L2Q+yI956VfebSzaU5BSOML9iUJ quzgDOvzkLR4uMs9iIrcStM2970vkGluy0cGH/9hE0wKonMHIzk5ohH0/M1Do5O8O/rf OJGH/cc4yL3SjMp+V0HY86hd6vxX3ETKB0RxGQL/fQFh6qdDRM27zsiJ7Icn5wDJXAjo maEg==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LeNT8aOI; spf=pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::62a as permitted sender) smtp.mailfrom=sam.van.den.berge@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com. [2a00:1450:4864:20::62a]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-4247d20bd9csi206475e9.2.2024.06.20.01.49.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jun 2024 01:49:37 -0700 (PDT) Received-SPF: pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::62a as permitted sender) client-ip=2a00:1450:4864:20::62a; Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-a6f85f82ffeso65682766b.0 for ; Thu, 20 Jun 2024 01:49:37 -0700 (PDT) X-Received: by 2002:a17:907:c713:b0:a6f:54fc:d921 with SMTP id a640c23a62f3a-a6fab605ee4mr347127966b.16.1718873376965; Thu, 20 Jun 2024 01:49:36 -0700 (PDT) Received: from OP01518NB.WTSOUT.OIP.LOCAL (mail.oip.be. [81.246.50.154]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f881fbdfcsm347392866b.121.2024.06.20.01.49.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jun 2024 01:49:36 -0700 (PDT) From: sam.van.den.berge@gmail.com To: swupdate@googlegroups.com Cc: Sam Van Den Berge Subject: [swupdate] [PATCH 1/1] handlers: ubivol: fix missing device strlen check Date: Thu, 20 Jun 2024 10:49:32 +0200 Message-Id: <20240620084932.4759-2-sam.van.den.berge@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240620084932.4759-1-sam.van.den.berge@gmail.com> References: <20240620084932.4759-1-sam.van.den.berge@gmail.com> MIME-Version: 1.0 X-Original-Sender: sam.van.den.berge@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LeNT8aOI; spf=pass (google.com: domain of sam.van.den.berge@gmail.com designates 2a00:1450:4864:20::62a as permitted sender) smtp.mailfrom=sam.van.den.berge@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , From: Sam Van Den Berge Commit "5604c225 handlers: ubivol: Allow specifying MTD device" breaks UBI A/B volume updates with an atomic swap at the end of the update because 1 strlen check is missing in ubi_volume_get_info. This fixes the following error: [ERROR] : SWUPDATE failed [0] ERROR : does not exist [ERROR] : SWUPDATE failed [0] ERROR : could not found UBI volume root_r [ERROR] : SWUPDATE failed [0] ERROR : execute postinstall scripts failed [ERROR] : SWUPDATE failed [1] Installation failed ! Signed-off-by: Sam Van Den Berge Reviewed-by: Dominique Martinet --- handlers/ubivol_handler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers/ubivol_handler.c b/handlers/ubivol_handler.c index 9db6472e..0ad0321e 100644 --- a/handlers/ubivol_handler.c +++ b/handlers/ubivol_handler.c @@ -506,7 +506,7 @@ static int ubi_volume_get_info(char *device, char *name, int *dev_num, int *vol_ { struct ubi_part *ubi_part; - if (device) + if (strlen(device)) ubi_part = search_volume_local(device, name); else ubi_part = search_volume_global(name);