<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15212</bug_id>
          
          <creation_ts>2023-09-11 11:07:41 +0000</creation_ts>
          <short_desc>u-boot partition environement variable is always writable regardless of force_ro value</short_desc>
          <delta_ts>2023-09-12 11:46:24 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BSPs</product>
          <component>bsps-configuration</component>
          <version>4.0</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>0.0.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="SAHEERK">saheer.kottakkadan</reporter>
          <assigned_to name="Unassigned">unassigned</assigned_to>
          <cc>yp.bsp.watcher</cc>
    
    <cc>yp.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>96394</commentid>
    <comment_count>0</comment_count>
    <who name="SAHEERK">saheer.kottakkadan</who>
    <bug_when>2023-09-11 11:07:41 +0000</bug_when>
    <thetext>On my platform, the u-boot environment variables can always be modified. Currently, I&apos;m changing the value of force_ro to &apos;1&apos;, which sets the permission mode to read-only.
This change is reflected in the output of the lsblk command. However, even after rebooting my device, I can still write values to my boot partition, and the changes persist.

Here are the results of my test:

$ cat /sys/block/mmcblk0boot1/force_ro
1 
$ fw_setenv primary 2 
$ fw_printenv primary
 2

Here are some details about my platform:
&gt; Cross Compiler: Yocto EL40(Kirkstone)
&gt; Bootloader: u-boot
&gt; U-boot Source: git://github.com/nxp-imx/uboot-imx.git;protocol=https
&gt; U-boot Source Branch: lf_v2022.04

&gt; fw_setenv and fw_printenv package version in Yocto: libubootenv_0.3.2

Hardware details:
&gt; System Architecture: arm
&gt; CPU: armv8
&gt; SoC: imx8m

Could anyone suggest a solution to make my boot partition read-only based on the value of force_ro?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96399</commentid>
    <comment_count>1</comment_count>
    <who name="SAHEERK">saheer.kottakkadan</who>
    <bug_when>2023-09-12 11:46:24 +0000</bug_when>
    <thetext>This issue reason was the libubootenv commit: https://github.com/sbabic/libubootenv/commit/92949816720d7af2ac722016e7a5b9a85ff141bc. which bypasses the force_ro protection to write. So for my platform, I am going to edit the source code of libubootenv


Thanks</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>