Skip to content

afs: Fix dynamic root interaction with failing DNS lookups

David Howells ceph-devel keyrings linux-cifs linux-fsdevel linux-nfs lkml netdev 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 2 repliesIn review
  2. v33 patches 2 repliesSuperseded
  3. v23 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches7 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3afs: Fix the dynamic root's d_delete to always delete unused dentriesfs/afs/dynroot.c+1 -120 replies
2/3afs: Fix dynamic root lookup DNS checkfs/afs/dynroot.c+16 -20 replies
3/3keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on expiryinclude/linux/key-type.h net/dns_resolver/dns_key.c security/keys/gc.c +3 more+47 -231 reply

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchMarkus SuvantoJeffrey Altman
SeriesR-b
1/3T-b
2/3T-b
3/3T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] afs: Fix dynamic root interaction with failing DNS lookups

Hi Markus, Marc,

Here's a set of fixes to improve the interaction of arbitrary lookups in the AFS dynamic root that hit DNS lookup failures[1]:

(1) Always delete unused (particularly negative) dentries as soon as possible so that they don't prevent future lookups from retrying.

(2) Fix the handling of new-style negative DNS lookups in ->lookup() to make them return ENOENT so that userspace doesn't get confused when stat succeeds but the following open on the looked up file then fails.

(3) Fix key handling so that DNS lookup results are reclaimed as soon as they expire rather than sitting round either forever or for an additional 5 mins beyond a set expiry time returning EKEYEXPIRED.

The patches can be found here:

https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=afs-fixes

Thanks,
David

Changes
=======
ver #4)
- Reduce the negative timeout from 10s to 1s.

ver #3)
- Rebased to v6.7-rc5 which has an additional afs patch.
- Don't add to TIME64_MAX (ie. permanent) when checking expiry time.

ver #2)
- Fix signed-unsigned comparison when checking return val.

David Howells (3):
afs: Fix the dynamic root's d_delete to always delete unused dentries
afs: Fix dynamic root lookup DNS check
keys, dns: Allow key types (eg. DNS) to be reclaimed immediately on
expiry

 fs/afs/dynroot.c           | 31 +++++++++++++++++--------------
 include/linux/key-type.h   |  1 +
 net/dns_resolver/dns_key.c | 10 +++++++++-
 security/keys/gc.c         | 31 +++++++++++++++++++++----------
 security/keys/internal.h   | 11 ++++++++++-
 security/keys/key.c        | 15 +++++----------
 security/keys/proc.c       |  2 +-
 7 files changed, 64 insertions(+), 37 deletions(-)