Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Enzo Matsumiya <ematsumiya@suse.de>
To: Steve French <smfrench@gmail.com>
Cc: linux-cifs@vger.kernel.org, pc@cjr.nz, ronniesahlberg@gmail.com,
	nspmangalore@gmail.com, tom@talpey.com, metze@samba.org
Subject: Re: [PATCH v4 0/8] cifs: introduce support for AES-GMAC signing
Date: Fri, 30 Sep 2022 00:27:39 -0300	[thread overview]
Message-ID: <20220930032739.4cujycd3sjsajr43@suse.de> (raw)
In-Reply-To: <CAH2r5mtJXYgQro1AgUD+A1fBq6SNNyYYS3KGCJFNj=711RroGg@mail.gmail.com>

On 09/29, Steve French wrote:
>improved ... but I see an out of memory error when I do this:
>
># dd if=/dev/zero of=/mnt1/file bs=4M count=1
>dd: closing output file '/mnt1/file': Cannot allocate memory
># dmesg
>[  439.674953] CIFS: VFS: \\localhost smb311_calc_aes_gmac: Failed to
>compute AES-GMAC signature, rc=-12

That's... weird, to say the least.  Creating a 4MB file is something
I *obviously* tested, and I never hit ENOMEM with this patch series.
For sanity check, I just tried to reproduce this and I'm not able to;
tried with several small files and also several large files.  Maybe send
me your setup details in a private email? Or at least what's the server
OS and version.

An interesting point here is that this error is coming from the crypto
API (crypto_aead_encrypt() in smb311_calc_aes_gmac())... sigh

>Attached is the trace-cmd output

I don't see much information regarding the signature computation nor
crypto code in the trace.  Did I miss something?

>Will also run some xfstests with this v4 series

The v4 changes shouldn't make much of a difference for this case, I
expect, but let me know how it goes.


Cheers,

Enzo

>On Thu, Sep 29, 2022 at 3:36 PM Enzo Matsumiya <ematsumiya@suse.de> wrote:
>>
>> v4:
>> Patches 3/8 and 6/8:
>>   - fix checkpatch errors (thanks to Steve)
>>
>> Patch 5/8:
>>   - rename smb311_calc_signature to smb311_calc_aes_gmac, and use SMB3_AES_GCM_NONCE
>>     instead of hardcoded '12' (suggested by metze)
>>   - update commit message to include the reasoning to move ->calc_signature op
>>
>> Patch 8/8:
>>   - move SMB2_PADDING_BUF to smb2glob.h
>>   - check if iov is SMB2_PADDING_BUF in the free functions where
>>     smb2_padding was previously used (pointed out by metze)
>>
>> Enzo Matsumiya (8):
>>   smb3: rename encryption/decryption TFMs
>>   cifs: secmech: use shash_desc directly, remove sdesc
>>   cifs: allocate ephemeral secmechs only on demand
>>   cifs: create sign/verify secmechs, don't leave keys in memory
>>   cifs: introduce AES-GMAC signing support for SMB 3.1.1
>>   cifs: deprecate 'enable_negotiate_signing' module param
>>   cifs: show signing algorithm name in DebugData
>>   cifs: use MAX_CIFS_SMALL_BUFFER_SIZE-8 as padding buffer
>>
>>  fs/cifs/cifs_debug.c    |   7 +-
>>  fs/cifs/cifsencrypt.c   | 157 ++++-------
>>  fs/cifs/cifsfs.c        |  14 +-
>>  fs/cifs/cifsglob.h      |  70 +++--
>>  fs/cifs/cifsproto.h     |   5 +-
>>  fs/cifs/link.c          |  13 +-
>>  fs/cifs/misc.c          |  49 ++--
>>  fs/cifs/sess.c          |  12 -
>>  fs/cifs/smb1ops.c       |   6 +
>>  fs/cifs/smb2glob.h      |  15 ++
>>  fs/cifs/smb2misc.c      |  29 +-
>>  fs/cifs/smb2ops.c       | 102 ++-----
>>  fs/cifs/smb2pdu.c       |  77 ++++--
>>  fs/cifs/smb2pdu.h       |   2 -
>>  fs/cifs/smb2proto.h     |  13 +-
>>  fs/cifs/smb2transport.c | 581 +++++++++++++++++++++-------------------
>>  16 files changed, 577 insertions(+), 575 deletions(-)
>>
>> --
>> 2.35.3
>>
>
>
>--
>Thanks,
>
>Steve

># tracer: nop
>#
># entries-in-buffer/entries-written: 63/63   #P:12
>#
>#                                _-----=> irqs-off/BH-disabled
>#                               / _----=> need-resched
>#                              | / _---=> hardirq/softirq
>#                              || / _--=> preempt-depth
>#                              ||| / _-=> migrate-disable
>#                              |||| /     delay
>#           TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
>#              | |         |   |||||     |         |
>              dd-4328    [005] .....   526.537605: smb3_enter:  cifs_revalidate_
>dentry_attr: xid=67
>              dd-4328    [005] .....   526.537631: smb3_query_info_compound_ente
>r: xid=67 sid=0xa43778ef tid=0x463e7cd2 path=\file
>              dd-4328    [005] .....   526.537635: smb3_waitff_credits: conn_id=
>0x1 server=localhost current_mid=193 credits=1187 credit_change=-3 in_flight=3
>              dd-4328    [005] .....   526.537638: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=5 mid=193
>              dd-4328    [005] .....   526.537650: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=16 mid=194
>              dd-4328    [005] .....   526.537654: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=6 mid=195
>           cifsd-4189    [004] .....   526.539030: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=196 credits=1187 credit_change=0 in_flight=2
>           cifsd-4189    [004] .....   526.539038: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=196 credits=1187 credit_change=0 in_flight=1
>           cifsd-4189    [004] .....   526.539047: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=196 credits=1217 credit_change=30 in_flight=0
>              dd-4328    [005] .....   526.539115: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=5 mid=193
>              dd-4328    [005] .....   526.539119: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=16 mid=194
>              dd-4328    [005] .....   526.539121: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=6 mid=195
>              dd-4328    [005] .....   526.539128: smb3_query_info_compound_done
>: xid=67 sid=0xa43778ef tid=0x463e7cd2
>              dd-4328    [005] .....   526.539138: smb3_exit_done:      cifs_rev
>alidate_dentry_attr: xid=67
>              dd-4328    [005] .....   526.541003: smb3_enter:  cifs_open: xid=6
>8
>              dd-4328    [005] .....   526.541020: smb3_open_enter: xid=68 sid=0
>x463e7cd2 tid=0xa43778ef cr_opts=0x40 des_access=0x40000080
>              dd-4328    [005] .....   526.541022: smb3_waitff_credits: conn_id=
>0x1 server=localhost current_mid=196 credits=1216 credit_change=-1 in_flight=1
>              dd-4328    [005] .....   526.541023: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=5 mid=196
>           cifsd-4189    [004] .....   526.542593: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=197 credits=1226 credit_change=10 in_flight=0
>              dd-4328    [005] .....   526.542661: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=5 mid=196
>              dd-4328    [005] .....   526.542665: smb3_open_done: xid=68 sid=0x
>463e7cd2 tid=0xa43778ef fid=0x8b46db33 cr_opts=0x40 des_access=0x40000080
>              dd-4328    [005] .....   526.542678: smb3_exit_done:      cifs_ope
>n: xid=68
>              dd-4328    [005] .....   526.542686: smb3_enter:  cifs_setattr_nou
>nix: xid=69
>              dd-4328    [005] .....   526.542692: smb3_flush_enter:    xid=69 s
>id=0x463e7cd2 tid=0xa43778ef fid=0x8b46db33
>              dd-4328    [005] .....   526.542694: smb3_waitff_credits: conn_id=
>0x1 server=localhost current_mid=197 credits=1225 credit_change=-1 in_flight=1
>              dd-4328    [005] .....   526.542696: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=7 mid=197
>           cifsd-4189    [004] .....   526.544236: smb3_pend_credits: conn_id=0x
>1 server=localhost current_mid=198 credits=1235 credit_change=10 in_flight=1
>           cifsd-4189    [004] .....   526.554127: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=198 credits=1235 credit_change=0 in_flight=0
>              dd-4328    [005] .....   526.554203: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0x0 cmd=7 mid=197
>              dd-4328    [005] .....   526.554207: smb3_flush_done:     xid=69 s
>id=0x463e7cd2 tid=0xa43778ef fid=0x8b46db33
>              dd-4328    [005] .....   526.554213: smb3_set_eof: xid=69 sid=0x46
>3e7cd2 tid=0xa43778ef fid=0x8b46db33 offset=0x0
>              dd-4328    [005] .....   526.554231: smb3_waitff_credits: conn_id=
>0x1 server=localhost current_mid=198 credits=1234 credit_change=-1 in_flight=1
>              dd-4328    [005] .....   526.554233: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=17 mid=198
>           cifsd-4189    [004] .....   526.554588: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=199 credits=1244 credit_change=10 in_flight=0
>              dd-4328    [005] .....   526.554656: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=17 mid=198
>              dd-4328    [005] .....   526.554686: smb3_set_info_compound_enter:
> xid=69 sid=0xa43778ef tid=0x463e7cd2 path=\file
>              dd-4328    [005] .....   526.554688: smb3_waitff_credits: conn_id=
>0x1 server=localhost current_mid=199 credits=1243 credit_change=-1 in_flight=1
>              dd-4328    [005] .....   526.554690: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=17 mid=199
>           cifsd-4189    [004] .....   526.555472: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=200 credits=1253 credit_change=10 in_flight=0
>              dd-4328    [005] .....   526.555557: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=17 mid=199
>              dd-4328    [005] .....   526.555562: smb3_set_info_compound_done:
>xid=69 sid=0xa43778ef tid=0x463e7cd2
>              dd-4328    [005] .....   526.555570: smb3_exit_done:      cifs_set
>attr_nounix: xid=69
>              dd-4328    [005] .....   526.562165: smb3_enter:  cifs_writepages:
> xid=70
>              dd-4328    [005] .....   526.562167: smb3_wait_credits: conn_id=0x
>1 server=localhost current_mid=200 credits=1189 credit_change=-64 in_flight=1
>              dd-4328    [005] .....   526.562496: smb3_write_enter: xid=0 sid=0
>x463e7cd2 tid=0xa43778ef fid=0x8b46db33 offset=0x0 len=0x400000
>              dd-4328    [005] .....   526.562498: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=9 mid=200
>              dd-4328    [005] .....   526.562520: smb3_write_err:      xid=0 si
>d=0x463e7cd2 tid=0xa43778ef fid=0x8b46db33 offset=0x0 len=0x400000 rc=-12
>              dd-4328    [005] .....   526.562530: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=200 credits=1253 credit_change=64 in_flight=0
>              dd-4328    [005] .....   526.562695: smb3_wait_credits: conn_id=0x
>1 server=localhost current_mid=200 credits=1189 credit_change=-64 in_flight=1
>              dd-4328    [005] .....   526.562696: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=200 credits=1253 credit_change=64 in_flight=0
>              dd-4328    [005] .....   526.562697: smb3_exit_err:       cifs_wri
>tepages: xid=70 rc=-12
>              dd-4328    [010] .....   526.666748: smb3_enter:  cifs_writepages:
> xid=71
>              dd-4328    [010] .....   526.666753: smb3_wait_credits: conn_id=0x
>1 server=localhost current_mid=200 credits=1189 credit_change=-64 in_flight=1
>              dd-4328    [010] .....   526.666762: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=200 credits=1253 credit_change=64 in_flight=0
>              dd-4328    [010] .....   526.666765: smb3_exit_done:      cifs_wri
>tepages: xid=71
>              dd-4328    [010] .....   526.666768: cifs_flush_err:      ino=5658
>09363 rc=-12
>    kworker/10:1-127     [010] .....   531.754716: smb3_enter:  _cifsFileInfo_pu
>t: xid=72
>    kworker/10:1-127     [010] .....   531.754720: smb3_close_enter:    xid=72 s
>id=0x463e7cd2 tid=0xa43778ef fid=0x8b46db33
>    kworker/10:1-127     [010] .....   531.754726: smb3_waitff_credits: conn_id=
>0x1 server=localhost current_mid=200 credits=1252 credit_change=-1 in_flight=1
>    kworker/10:1-127     [010] .....   531.754730: smb3_cmd_enter:      sid=0x46
>3e7cd2 tid=0xa43778ef cmd=6 mid=200
>           cifsd-4189    [004] .....   531.755769: smb3_add_credits: conn_id=0x1
> server=localhost current_mid=201 credits=1262 credit_change=10 in_flight=0
>    kworker/10:1-127     [010] .....   531.755802: smb3_cmd_done:       sid=0x46
>3e7cd2 tid=0xa43778ef cmd=6 mid=200
>    kworker/10:1-127     [010] .....   531.755806: smb3_close_done:     xid=72 s
>id=0x463e7cd2 tid=0xa43778ef fid=0x8b46db33
>


      parent reply	other threads:[~2022-09-30  3:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 20:36 [PATCH v4 0/8] cifs: introduce support for AES-GMAC signing Enzo Matsumiya
2022-09-29 20:36 ` [PATCH v4 1/8] smb3: rename encryption/decryption TFMs Enzo Matsumiya
2022-10-04 18:49   ` Paulo Alcantara
2022-09-29 20:36 ` [PATCH v4 2/8] cifs: secmech: use shash_desc directly, remove sdesc Enzo Matsumiya
2022-10-04 18:50   ` Paulo Alcantara
2022-10-05  8:04     ` Steve French
2022-09-29 20:36 ` [PATCH v4 4/8] cifs: create sign/verify secmechs, don't leave keys in memory Enzo Matsumiya
2022-09-29 20:36 ` [PATCH v4 7/8] cifs: show signing algorithm name in DebugData Enzo Matsumiya
2022-09-30  3:03 ` [PATCH v4 0/8] cifs: introduce support for AES-GMAC signing Steve French
2022-09-30  3:12   ` Steve French
2022-09-30  3:27   ` Enzo Matsumiya [this message]

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=20220930032739.4cujycd3sjsajr43@suse.de \
    --to=ematsumiya@suse.de \
    --cc=linux-cifs@vger.kernel.org \
    --cc=metze@samba.org \
    --cc=nspmangalore@gmail.com \
    --cc=pc@cjr.nz \
    --cc=ronniesahlberg@gmail.com \
    --cc=smfrench@gmail.com \
    --cc=tom@talpey.com \
    /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