public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 10/12] env: acl: Add environment variable access control list
Date: Fri, 14 Sep 2012 20:42:26 +0200	[thread overview]
Message-ID: <20120914184226.C50F92002E4@gemini.denx.de> (raw)
In-Reply-To: <CANr=Z=b6wJCOxVc+zi6riiU4Smv5tv_5ifS1d9Ue8Ncv+xVLyg@mail.gmail.com>

Dear Joe Hershberger,

In message <CANr=Z=b6wJCOxVc+zi6riiU4Smv5tv_5ifS1d9Ue8Ncv+xVLyg@mail.gmail.com> you wrote:
> 
> I guess you didn't see this the last time I sent it to you off list...

I didn't receive any such reply, sorry.  Do you have the message ID
and/or exact timestanmp of your message?


> > - It appears you will store all access related information in the ACL
> >   variable (or a copy of it), i. e. in linearized form.  Are you not
> >   concerned that this will make variable access slow?
> 
> At least in my uses so far, there are not so many variables that it is
> noticeably slower.

Did you run any benchmarks?

Note that in the linearized form not only the variable count, but also
to total size of their values plays a role.

> > - There have been discussions that it would be nice to have a
> >   "volatile" variable type, for example for variables like "filesize"
> >   or "loadaddr" - such variables would not be stored to the persistent
> >   storage by the "saveenv" command.  Thi sis something that should be
> >   fairly wasy to add to your code.
> 
> I was one of the proponents of this when we last discussed this some
> years ago.  I left it out because you convinced me I should just use
> other variables and overwrite the special ones in a script when I need
> to.  I still think supporting a volatile variable would be cleaner
> than that.  I'm glad you changed your mind.

I always try to listen to what people tell me :-)

> > - Instead of parsing the ".flags" variable again and again when
> >   accessing variables, my idea was to extend the hash table: so far,
> >   the struct entry (see "include/search.h") holds only pointers to the
> >   key (variable name) and data (variable value).  I suggest to
> >   extend this struct:
> 
> This seems like a good idea for the most part.  Are you concerned that
> the hast table will take twice the space?  Should this be optional?

The hash table lives in RAM only, which is usually an ample resource
these days.  I suggest to make the ".flags" support unconditional, but
".groups" support is probably not needed by many users, so this should
be optional.

So the default configuration whould have only a 50% increase of the
hash table size.

> >     .callbacks=ethaddr:ethaddr,eth1addr,ath2addr;baudrate:baudrate;...
> 
> One of the things I've run into with baudrate and silent specifically
> is wanting to control if the special callback is made on set and/or on
> env relocation, and/or on initial load, and/or on import.  I think
> there should be a field in the flags for when to check the callback.

I don't see the need for this distinction, yet.  My gut feeling is
that the callback should be run when the varibale value in the hash
table is being changed - relocation should play no role then, and
initial import, "env set", "env import" (including variable deletion)
should IMO all be handled the same.

I'd really like to make this code more simple.

> >     This way we could even enale user specific callbacks without need
> >     to modify any common code.
> 
> Would the user be able to define other callbacks somehow?

Yes.  Similar as he can add "private" U-Boot commands in his board
specific code, he should be able to add "private" callbacks.

> I think is sounds very nice.  And it's not too far from what I've
> done.  I'll look into implementing some of it.

I was hoping for such a reply :-)

Thanks a lot in advance.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
PLEASE NOTE: Some Quantum Physics Theories Suggest That When the Con-
sumer Is Not Directly Observing This Product, It May Cease  to  Exist
or Will Exist Only in a Vague and Undetermined State.

  reply	other threads:[~2012-09-14 18:42 UTC|newest]

Thread overview: 124+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-28  2:07 [U-Boot] Read-only env variables Joe Hershberger
2010-05-06 21:58 ` Wolfgang Denk
2010-05-10  6:30   ` Joe Hershberger
2010-05-10  6:56     ` Wolfgang Denk
2010-05-10 19:16       ` Joe Hershberger
2010-05-10 20:43         ` Wolfgang Denk
2010-05-10 21:33           ` Joe Hershberger
2010-05-11 20:19             ` Craig Millen
2010-05-11 22:03               ` Wolfgang Denk
2010-05-11 22:52                 ` Joe Hershberger
2010-05-12  9:34                   ` Wolfgang Denk
2010-05-12 23:46                     ` Joe Hershberger
2010-06-22 21:18                       ` Wolfgang Denk
2010-06-22 21:49                         ` Joe Hershberger
2010-06-22 22:29                           ` Wolfgang Denk
2012-08-17 20:49                             ` [U-Boot] [PATCH 0/12] Add environment type checking and access control Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 01/12] tools/env: Use a board-specific default env Joe Hershberger
2012-08-23  3:17                                 ` Mike Frysinger
2012-08-23 15:45                                   ` Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 02/12] tools/env: Remove unneeded complexity Joe Hershberger
2012-08-23  3:30                                 ` Mike Frysinger
2012-08-17 20:49                               ` [U-Boot] [PATCH 03/12] tools/env: Don't call env_init() in fw_getenv() Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 04/12] tools/env: Reduce the impact on real-time processes Joe Hershberger
2012-08-23  3:30                                 ` Mike Frysinger
2012-08-23 16:26                                   ` Joe Hershberger
2012-08-23 20:31                                     ` Mike Frysinger
2012-08-17 20:49                               ` [U-Boot] [PATCH 05/12] tools/env: Serialize calls to fw_*env Joe Hershberger
2012-08-23  3:33                                 ` Mike Frysinger
2012-10-03  1:12                                   ` Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 06/12] env: Make the "silent" env var take effect immediately Joe Hershberger
2012-08-23  3:35                                 ` Mike Frysinger
2012-08-17 20:49                               ` [U-Boot] [PATCH 07/12] env: Update serial baudrate in env_relocate() Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 08/12] env: Check for NULL pointer in envmatch() Joe Hershberger
2012-08-17 23:51                                 ` Mike Frysinger
2012-08-17 20:49                               ` [U-Boot] [PATCH 09/12] env: Clarify the cases for env set Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 10/12] env: acl: Add environment variable access control list Joe Hershberger
2012-08-23  3:43                                 ` Mike Frysinger
2012-09-13 20:13                                 ` Wolfgang Denk
2012-09-14  2:24                                   ` Joe Hershberger
2012-09-14 18:42                                     ` Wolfgang Denk [this message]
2012-11-01 16:39                                       ` [U-Boot] [PATCH v3 0/18] Add environment call-back and flags capability Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 01/18] Make linux kernel string funcs available to tools Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 02/18] env: Refactor do_apply to a flag Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 03/18] env: Consolidate common code in hsearch_r() Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 04/18] env: Refactor apply into change_ok Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 05/18] env: Use getenv_yesno() more generally Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 06/18] env: Hide '.' variables in env print by default Joe Hershberger
2012-11-02 10:44                                           ` Luka Perkov
2012-11-02 22:23                                             ` Wolfgang Denk
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 07/18] env: Add support for callbacks to environment vars Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 08/18] env: Add a command to view callbacks Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 09/18] env: Add a bootfile env handler Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 10/18] env: Add a baudrate " Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 11/18] env: Add a loadaddr " Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 12/18] env: Add a console " Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 13/18] env: Add a silent " Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 14/18] env: Add environment variable flags Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 15/18] tools/env: Add environment variable flags support Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 16/18] env: Add a command to display details about env flags Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 17/18] env: Add support for access control to .flags Joe Hershberger
2012-11-01 16:39                                         ` [U-Boot] [PATCH v3 18/18] env: Handle write-once ethaddr and serial# generically Joe Hershberger
2012-11-02 22:40                                         ` [U-Boot] [PATCH v3 0/18] Add environment call-back and flags capability Wolfgang Denk
2012-11-05  0:15                                           ` Joe Hershberger
2012-12-01 19:44                                           ` Joe Hershberger
2012-12-05  1:52                                         ` [U-Boot] [PATCH v4 0/20] " Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 01/20] Make linux kernel string funcs available to tools Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 02/20] env: Refactor do_apply to a flag Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 03/20] env: Consolidate common code in hsearch_r() Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 04/20] env: Refactor apply into change_ok Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 05/20] env: Use getenv_yesno() more generally Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 06/20] env: Hide '.' variables in env print by default Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 07/20] env: Add support for callbacks to environment vars Joe Hershberger
2012-12-05  2:34                                             ` Graeme Russ
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 08/20] env: Add a command to view callbacks Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 09/20] env: Add a bootfile env handler Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 10/20] env: Add a baudrate " Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 11/20] env: Add a loadaddr " Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 12/20] env: Add a console " Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 13/20] env: Add a silent " Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 14/20] env: Add environment variable flags Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 15/20] tools/env: Add environment variable flags support Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 16/20] env: Add a command to display details about env flags Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 17/20] env: Add support for access control to .flags Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 18/20] env: Add setenv force support Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 19/20] env: Implement the env delete command Joe Hershberger
2012-12-05  1:52                                           ` [U-Boot] [PATCH v4 20/20] env: Handle write-once ethaddr and serial# generically Joe Hershberger
2012-12-11 16:51                                           ` [U-Boot] [PATCH v4 0/20] Add environment call-back and flags capability Tom Rini
2012-12-12  4:16                                           ` [U-Boot] [PATCH v5 " Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 01/20] Make linux kernel string funcs available to tools Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 02/20] env: Refactor do_apply to a flag Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 03/20] env: Consolidate common code in hsearch_r() Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 04/20] env: Refactor apply into change_ok Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 05/20] env: Use getenv_yesno() more generally Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 06/20] env: Hide '.' variables in env print by default Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 07/20] env: Add support for callbacks to environment vars Joe Hershberger
2013-01-11  8:06                                               ` Stefan Roese
2013-01-14 23:23                                                 ` Joe Hershberger
2013-01-15  6:51                                                   ` Stefan Roese
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 08/20] env: Add a command to view callbacks Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 09/20] env: Add a bootfile env handler Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 10/20] env: Add a baudrate " Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 11/20] env: Add a loadaddr " Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 12/20] env: Add a console " Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 13/20] env: Add a silent " Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 14/20] env: Add environment variable flags Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 15/20] tools/env: Add environment variable flags support Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 16/20] env: Add a command to display details about env flags Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 17/20] env: Add support for access control to .flags Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 18/20] env: Add setenv force support Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 19/20] env: Implement the env delete command Joe Hershberger
2012-12-12  4:16                                             ` [U-Boot] [PATCH v5 20/20] env: Handle write-once ethaddr and serial# generically Joe Hershberger
2012-12-14 16:05                                             ` [U-Boot] [PATCH v5 0/20] Add environment call-back and flags capability Tom Rini
2012-08-17 20:49                               ` [U-Boot] [PATCH 11/12] env: acl: Add support for access control to env ACL Joe Hershberger
2012-08-17 20:49                               ` [U-Boot] [PATCH 12/12] env: cosmetic: Consilidate the default env definition Joe Hershberger
2012-08-23  3:44                                 ` Mike Frysinger
2012-10-03 19:38                               ` [U-Boot] [PATCH v2 0/5] Cleanup fw_*env and a few common env Joe Hershberger
2012-10-03 19:38                                 ` [U-Boot] [PATCH v2 1/5] tools/env: Use a board-specific default env Joe Hershberger
2012-10-03 19:38                                 ` [U-Boot] [PATCH v2 2/5] tools/env: Remove unneeded complexity Joe Hershberger
2012-10-03 19:38                                 ` [U-Boot] [PATCH v2 3/5] tools/env: Don't call env_init() in fw_getenv() Joe Hershberger
2012-10-03 19:38                                 ` [U-Boot] [PATCH v2 4/5] tools/env: Serialize calls to fw_*env Joe Hershberger
2012-10-03 23:24                                   ` uboot at lukaperkov.net
2012-10-04 18:31                                     ` [U-Boot] [PATCH] tools: Add a README note about fw_printenv lock file Joe Hershberger
2012-10-03 19:38                                 ` [U-Boot] [PATCH v2 5/5] env: Check for NULL pointer in envmatch() Joe Hershberger
2012-10-09 17:13                                 ` [U-Boot] [PATCH v2 0/5] Cleanup fw_*env and a few common env Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120914184226.C50F92002E4@gemini.denx.de \
    --to=wd@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox