----- "Stefan Richter" <[email protected]> wrote: > Miloslav Trmač wrote: > > --- /dev/null > > +++ b/crypto/userspace/utils.c > [...] > > +#ifdef CONFIG_COMPAT > > +/* max() is too clever for compile-time constants */ > > +#define CONST_MAX(A, B) ((A) > (B) ? (A) : (B)) > > + > > +#define MAX_SESSION_INPUT_DATA_SIZE > > \ > > + (CONST_MAX(sizeof(struct ncr_session_input_data), \ > > + sizeof(struct compat_ncr_session_input_data))) > > +#define MAX_SESSION_OUTPUT_BUFFER_SIZE > > \ > > + (CONST_MAX(sizeof(struct ncr_session_output_buffer), \ > > + sizeof(struct compat_ncr_session_output_buffer))) > > + > > +#else /* !CONFIG_COMPAT */ > > + > > +#define MAX_SESSION_INPUT_DATA_SIZE (sizeof(struct ncr_session_input_data)) > > +#define MAX_SESSION_OUTPUT_BUFFER_SIZE \ > > + (sizeof(struct ncr_session_output_buffer)) > > + > > +#endif /* !CONFIG_COMPAT */ > > struct compat_xyz cannot be bigger than struct xyz, can it? Perhaps not, but the code has been written and it's easier to keep it than to speculate :) It also helps document the fact that the data format depends on properties of the userspace. Mirek -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
- [PATCH 00/19] RFC, v2: "New" /dev/crypto user-sp... Miloslav Trmač
- [PATCH 01/19] User-space API definition Miloslav Trmač
- Re: [PATCH 01/19] User-space API definition Stefan Richter
- Re: [PATCH 01/19] User-space API definition Randy Dunlap
- [PATCH 02/19] Add CRYPTO_USERSPACE config option Miloslav Trmač
- [PATCH 05/19] Add internal /dev/crypto implementation... Miloslav Trmač
- [PATCH 08/19] Add per-process and per-user limits Miloslav Trmač
- [PATCH 07/19] Add crypto API utilities. Miloslav Trmač
- [PATCH 06/19] Add ioctl() argument and attribute hand... Miloslav Trmač
- Re: [PATCH 06/19] Add ioctl() argument and attrib... Stefan Richter
- Re: [PATCH 06/19] Add ioctl() argument and at... Miloslav Trmac
- Re: [PATCH 06/19] Add ioctl() argument an... Stefan Richter
- [PATCH 04/19] Add libtomcrypt headers Miloslav Trmač
- [PATCH 19/19] Finally, add the /dev/crypto device. Miloslav Trmač
- [PATCH 18/19] Add ioctl handlers Miloslav Trmač
- [PATCH 17/19] Add session operations Miloslav Trmač
- [PATCH 16/19] Add helpers for zero-copy userspace acc... Miloslav Trmač
- [PATCH 15/19] Add key wrapping operations Miloslav Trmač
- [PATCH 14/19] Add most operations on key objects. Miloslav Trmač
- [PATCH 12/19] Add DH implementation and pubkey abstra... Miloslav Trmač
- [PATCH 13/19] Add /dev/crypto auditing infrastructure Miloslav Trmač
