Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvram: bogus partition listing #96

Open
nathanlynch opened this issue Feb 28, 2024 · 0 comments
Open

nvram: bogus partition listing #96

nathanlynch opened this issue Feb 28, 2024 · 0 comments
Labels

Comments

@nathanlynch
Copy link
Contributor

Since a6d31ca, nvram --partitions with large enough argument passed to --nvram-size prints a bogus all-zeros entry at the end:

[root@ltc-zz14-lp1 ~]# ~test/powerpc-utils/src/nvram --partitions
 # Sig Chk  Len  Name
 0  50  ef  0024 of-config
 1  70  99  009d common
 2  a0  b5  0083 ibm,rtas-log
 3  a0  4f  00fb lnx,oops-log
 4  7f  9b  0181 wwwwwwwwwwww
[root@ltc-zz14-lp1 ~]# ~test/powerpc-utils/src/nvram --partitions --nvram-size $((16 * 1024))
/home/test/powerpc-utils/src/nvram: WARNING: expected 16384 bytes, but only read 15360!
 # Sig Chk  Len  Name
 0  50  ef  0024 of-config
 1  70  99  009d common
 2  a0  b5  0083 ibm,rtas-log
 3  a0  4f  00fb lnx,oops-log
 4  7f  9b  0181 wwwwwwwwwwww
 5  00  00  0000                        <<<<<<<<<<

When the user forces there to be excess space in the nvram buffer, nvram_parse_partitions() constructs a bogus entry from the (fortunately zeroed) remainder.

I propose either:

  1. Ignoring --nvram-size with a warning, removing all supporting code. I don't know of a use for it, at least not on LPARs. Or:
  2. Clamping the nvram buffer allocation to the lesser of the user-supplied value and the size reported by the device.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant